summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/api.js6
-rw-r--r--lib/ships.js2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/api.js b/lib/api.js
index 8ece296..d8010a9 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -65,6 +65,12 @@ function send_this(data) {
.then(response => response.json())
.then(async response => {
switch(response.error?.code) {
+ //case 401: // 401 means a server reset happened
+ // close database file
+ // rm database file
+ // logrotate
+ // spawnSync
+ // break;
case 429: // 429 means rate limited, let's hold back for 10 seconds
await sleep(10000);
queue.enqueue(data, 1);
diff --git a/lib/ships.js b/lib/ships.js
index 23f272d..c1bba08 100644
--- a/lib/ships.js
+++ b/lib/ships.js
@@ -61,6 +61,8 @@ export async function navigate(ctx) {
dbShips.setShipNav(ctx.symbol, response.data.nav);
const delay = new Date(response.data.nav.route.arrival) - new Date();
await api.sleep(delay);
+ response.data.nav.status = 'IN_ORBIT';
+ dbShips.setShipNav(ctx.symbol, response.data.nav);
return response;
}