Commit 6803065e by 朱建香

#1:uloop参数更改

parent 89fc4d3d
...@@ -11,7 +11,7 @@ class Loop{ ...@@ -11,7 +11,7 @@ class Loop{
this.watcher = null; this.watcher = null;
this.time = null; this.time = null;
this.loopContent = params.loopContent; this.loopContent = params.loopContent;
this.timeout = params.timeout || 10; this.times = params.times || 10;
this.fincb = params.fincb; this.fincb = params.fincb;
this.intervalTime = params.interval.delay; this.intervalTime = params.interval.delay;
this.intervalcb = params.interval.cb; this.intervalcb = params.interval.cb;
...@@ -82,7 +82,7 @@ class Loop{ ...@@ -82,7 +82,7 @@ class Loop{
this.handle = setInterval(() => { this.handle = setInterval(() => {
times++; times++;
console.log('times'+times); console.log('times'+times);
if(times > this.timeout){ if(times > this.times){
this.clearTime(); this.clearTime();
this.canDo = false; this.canDo = false;
this.fincb.error('timeout'); this.fincb.error('timeout');
......
...@@ -23,7 +23,7 @@ class unotify{ ...@@ -23,7 +23,7 @@ class unotify{
loopContent: () => { loopContent: () => {
return self.getCidOnce(); return self.getCidOnce();
}, },
timeout: times, times: times,
interval:{ interval:{
delay: 1000, delay: 1000,
cb: { cb: {
......
...@@ -689,7 +689,7 @@ async function loopGetLockInfo(self, delay, timeout){ ...@@ -689,7 +689,7 @@ async function loopGetLockInfo(self, delay, timeout){
return iot.business.api.send('lock/getNewInfo', urlParams, true, false); return iot.business.api.send('lock/getNewInfo', urlParams, true, false);
// return plus.push.getClientInfo().clientid; // return plus.push.getClientInfo().clientid;
}, },
timeout: 3, times: 3,
interval:{ interval:{
delay: config.intervalTime*1000, delay: config.intervalTime*1000,
cb: { cb: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment