KOSASIH / pi-nexus-autonomous-banking-network

Prefer using $timeout instead of setTimeout JS-0562
Anti-pattern
Minor
4 months ago4 months old
You should use the $timeout service instead of the default window.setTimeout method
12  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 {
You should use the $timeout service instead of the default window.setTimeout method
50  }
51
52  // Loop to replicate data continuously
53  setTimeout(replicationFunction, 1000);54};
55
56// Start replication function