Currency service injects additional latency on predictable schedule
This commit is contained in:
parent
7118a692cc
commit
a6369c79e3
1 changed files with 7 additions and 1 deletions
|
@ -71,7 +71,13 @@ function _loadProto (path) {
|
|||
*/
|
||||
function _getCurrencyData (callback) {
|
||||
const data = require('./data/currency_conversion.json');
|
||||
callback(data);
|
||||
// Currency conversion API slows down during peak hours.
|
||||
let delay = 0;
|
||||
const hour = new Date().getHours();
|
||||
if (hour > 8 && hour < 17) {
|
||||
delay = 100; // add 100ms slowdown
|
||||
}
|
||||
setTimeout(callback(data), delay);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue