$timeout
instead of setTimeout
JS-056212 const limit = await limiter.get();
13 if (limit.remaining === 0) {
14 console.log('Rate limit exceeded. Waiting for 1 hour...');
15 await new Promise(resolve => setTimeout(resolve, 3600000));16 }
17
18 try {
50 }
51
52 // Loop to replicate data continuously
53 setTimeout(replicationFunction, 1000);54};
55
56// Start replication function
Instead of the default setTimeout function, you should use the AngularJS wrapper service $timeout.
Rule based on Angular 1.x
// invalid
setTimeout(function() {
// ...
}, 1000) // error: You should use the $timeout service instead of the default window.setTimeout method
// invalid
window.setTimeout(function() {
// ...
}, 1000) // error: You should use the $timeout service instead of the default window.setTimeout method
// invalid
$window.setTimeout(function() {
// ...
}, 1000) // error: You should use the $timeout service instead of the default window.setTimeout method
// valid
$timeout(function() {
// ...
}, 1000)