Mostly working now. Need to work on updates for files and token refresh. And probably other thigns..

This commit is contained in:
Scott Idem
2020-02-13 21:43:57 -05:00
parent 9a325c7543
commit 8a6123762b
3 changed files with 206 additions and 169 deletions

View File

@@ -241,6 +241,8 @@
const api_auth_loop_interval = 100; // only runs on start up
const open_tables_loop_interval = 10; // only runs on start up
const api_token_update_loop_interval = 120000; // loop forever
const update_idb_loop_interval = 500; // loop forever; update when check datetime has passed
const idb_to_launcher_loop_interval = 5000; // loop forever; only run when one or more tables are updated
const update_render_loop_interval = 10000; // loop forever; only run when the launcher object is safe
@@ -456,8 +458,14 @@
}, update_idb_loop_interval);
var idb_to_launcher_loop = setInterval(function() {
}, idb_to_launcher_loop_interval);
var api_token_update_loop = setInterval(function() {
api.api_token_request_async(axios, secret_key).then( function(result) {
console.log('Setting temporary API token to axios Authorization header: '+result);
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
api_temporary_token = result;
return result;
});
}, api_token_update_loop_interval);
var update_render_loop = setInterval(async function() {