Aggiunge 2 nuove variabili d'ambiente:
- SIGNALK_FILES, per specificare dove verranno salvati i file generati dal plugin - HOST_NAME, per specificare il nome del dispositivo che sta hostando il plugin. Inoltre, migliora il codice e lo adatta al nuovo path variabile SIGNALK_FILES
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { config } = require("./config.js");
|
||||
const { config, paths } = require("./config.js");
|
||||
const { setupRoutes, getOpenApiSpec } = require("./tools/routes.js");
|
||||
const { aisStream } = require("./api_models/aisstream.js")
|
||||
const mapHandler = require("./tools/map.handler.js");
|
||||
@@ -81,8 +81,8 @@ const state = {
|
||||
startTime: null
|
||||
};
|
||||
|
||||
const logsDirectory = dataUtils.getDirectory(__dirname + '/datasetModels/saved_datas');
|
||||
const logsReferencesFile = path.join(__dirname, 'datasetModels/logs_references.json');
|
||||
const logsDirectory = dataUtils.getDirectory(paths.savedDatas);
|
||||
const logsReferencesFile = paths.logsReferences;
|
||||
const lastCallRef = { current: null };
|
||||
|
||||
|
||||
@@ -506,7 +506,8 @@ module.exports = function (app) {
|
||||
if (config.telegramBotToken) {
|
||||
try {
|
||||
await linkBot(app);
|
||||
await send("✅ Computer di bordo attivo e pronto.");
|
||||
let deviceName = process.env.HOST_NAME || 'Dispositivo Sconosciuto';
|
||||
await send(`Il bot è di nuovo disponibile. (Avviato da ${deviceName})`);
|
||||
console.log('[MEB TELEGRAM] Bot avviato con app.intervalControl disponibile');
|
||||
} catch (error) {
|
||||
console.error('[ERROR] Errore nell\'avvio del bot telegram', error);
|
||||
|
||||
Reference in New Issue
Block a user