diff options
Diffstat (limited to 'automation/exploration.js')
-rw-r--r-- | automation/exploration.js | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/automation/exploration.js b/automation/exploration.js deleted file mode 100644 index b35efe0..0000000 --- a/automation/exploration.js +++ /dev/null @@ -1,21 +0,0 @@ -import * as db from '../database/systems.js'; -import * as api from '../lib/api.js'; - -// Retrieves all systems information, should be called only once after registering -export async function init() { - if (db.isInit()) { - return; - } - for (let page=1; true; ++page) { - const response = await api.send({endpoint: `/systems?limit=20&page=${page}`, priority:100}); - if (response.error !== undefined) { - throw response; - } - response.data.forEach(system => db.setSystem(system)); - if (response.meta.total <= response.meta.limit * page) { - break; - } - } - console.log('Finished retrieving all systems information'); - db.init(); -} |