provisioning script pause

Bodlaj Gasper bodlaj at iskratel.si
Sun Nov 26 14:34:37 EST 2017


Hi, managed to get it working.

Max wait time is 2 sec but it is enough.

2017-11-26T19:30:20.162Z [INFO] Script: DEBUG: Start 2 Sec wait!
2017-11-26T19:30:20.164Z [INFO] Waiting for timeout! It will took: ; waitTime="2000"
2017-11-26T19:30:22.169Z [INFO] Script: DEBUG: End 2 Sec wait!

Here is the wait.js content:

logger = require('../../lib/logger');

function setWait(args, callback) {
  let waitTime = args[0];
  //Logger functions are: info, warn, error
  logger.info({message: 'Waiting for timeout! It will took: ', waitTime: waitTime}); //message is the only required argument

  setTimeout(function(){
     callback(null);
  }, waitTime);
}
exports.setWaitTimeout = setWait;

and here is how i call it

ext("wait", "setWaitTimeout ","2000");

BR Gašper

-----Original Message-----
From: Users [mailto:users-bounces at lists.genieacs.com] On Behalf Of Oliver Kraitschy
Sent: Sunday, November 26, 2017 10:38 AM
To: users at lists.genieacs.com
Subject: Re: provisioning script pause

https://github.com/zaidka/genieacs/wiki/Extensions

Am 26.11.2017 um 10:15 schrieb Bodlaj Gasper:
> Ok, device needs a second or two to enable some services and in the 
> meantime tr69 stack in unreliable.
> 
> Is there any example how to call external script?
> 
> *From:*Users [mailto:users-bounces at lists.genieacs.com] *On Behalf Of 
> *Dan Morphis
> *Sent:* Sunday, November 26, 2017 1:42 AM
> *To:* Community support for GenieACS users
> *Subject:* Re: provisioning script pause
> 
> You can call out to an extension script and do your pause in there. 
> But I have to ask, why do you need to pause?
> 
> -dan
> 
> On Fri, Nov 24, 2017 at 5:24 AM, Bodlaj Gasper <bodlaj at iskratel.si 
> <mailto:bodlaj at iskratel.si>> wrote:
> 
> Hi,
> is there any way to pause the provisining script execution for a 
> second or two?
> 
> *BR Gašper*
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com <mailto:Users at lists.genieacs.com> 
> http://lists.genieacs.com/mailman/listinfo/users
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
> 

_______________________________________________
Users mailing list
Users at lists.genieacs.com
http://lists.genieacs.com/mailman/listinfo/users


More information about the Users mailing list