From 234770b611df32178382b557df396db220070a7f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 5 Apr 2024 00:42:30 +0200 Subject: [node] Big Ships lib refactoring --- nodejs/automation/init.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'nodejs/automation/init.ts') diff --git a/nodejs/automation/init.ts b/nodejs/automation/init.ts index 79c5e39..1e8ea72 100644 --- a/nodejs/automation/init.ts +++ b/nodejs/automation/init.ts @@ -1,16 +1,16 @@ import * as dbAgents from '../database/agents.ts'; import * as db from '../database/db.ts'; import * as dbContracts from '../database/contracts.ts'; -import * as dbShips from '../database/ships.ts'; import * as dbTokens from '../database/tokens.ts'; -import { Agent } from '../model/agent.ts'; -import { Response } from '../model/api.ts'; -import { Contract } from '../model/contract.ts'; -import { Ship } from '../model/ship.ts'; -import * as api from '../lib/api.ts'; -//import * as agents from '../lib/angent.ts'; +import { + Response, +} from '../lib/api.ts'; +import { + Agent, + Contract, +} from '../lib/types.ts'; +import { Ship } from '../lib/ships.ts'; import * as libContracts from '../lib/contracts.ts'; -import * as libShips from '../lib/ships.ts'; const symbol = process.env.NODE_ENV === 'test' ? 'ADYXAX-0' : 'ADYXAX-JS'; @@ -32,7 +32,6 @@ export async function init(): Promise { case 4111: // 4111 means the agent symbol has already been claimed so no server reset happened // TODO await agents.agents(); await libContracts.getContracts(); - await libShips.getShips(); return; default: throw json; @@ -42,7 +41,4 @@ export async function init(): Promise { dbTokens.addToken(json.data.token); dbAgents.addAgent(json.data.agent); dbContracts.setContract(json.data.contract); - dbShips.setShip(json.data.ship); - // Temporary fix to fetch the data on the startup probe - await libShips.getShips(); } -- cgit v1.2.3