mirror of
https://github.com/elisspace/FxLifeSheet.git
synced 2026-08-29 15:44:00 +00:00
Fix rate limit
This commit is contained in:
6
web.js
6
web.js
@@ -8,8 +8,8 @@ var google_sheets = require("./classes/google_sheets.js");
|
||||
// State
|
||||
var lastFetchedData = {};
|
||||
var rawDataSheetRef = null;
|
||||
google_sheets.setupGoogleSheets(initMoodAPI);
|
||||
function initMoodAPI(rawDataSheet, lastRunSheet) {
|
||||
google_sheets.setupGoogleSheets(initAPI);
|
||||
function initAPI(rawDataSheet, lastRunSheet) {
|
||||
rawDataSheetRef = rawDataSheet;
|
||||
console.log("Launching up API web server...");
|
||||
// Periodically refresh the value
|
||||
@@ -32,7 +32,7 @@ function initMoodAPI(rawDataSheet, lastRunSheet) {
|
||||
loadCurrentData(key);
|
||||
}, interval + i * 2500);
|
||||
// to avoid rate limits
|
||||
setInterval(function () {
|
||||
setTimeout(function () {
|
||||
loadCurrentData(key);
|
||||
}, i * 2000);
|
||||
lastFetchedData[key] = {
|
||||
|
||||
6
web.ts
6
web.ts
@@ -9,9 +9,9 @@ let google_sheets = require("./classes/google_sheets.js");
|
||||
var lastFetchedData = {};
|
||||
let rawDataSheetRef = null;
|
||||
|
||||
google_sheets.setupGoogleSheets(initMoodAPI);
|
||||
google_sheets.setupGoogleSheets(initAPI);
|
||||
|
||||
function initMoodAPI(rawDataSheet, lastRunSheet) {
|
||||
function initAPI(rawDataSheet, lastRunSheet) {
|
||||
rawDataSheetRef = rawDataSheet;
|
||||
console.log("Launching up API web server...");
|
||||
|
||||
@@ -36,7 +36,7 @@ function initMoodAPI(rawDataSheet, lastRunSheet) {
|
||||
}, interval + i * 2500);
|
||||
|
||||
// to avoid rate limits
|
||||
setInterval(function() {
|
||||
setTimeout(function() {
|
||||
loadCurrentData(key);
|
||||
}, i * 2000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user