Теперь при запуске одного из JS сервисов, будет создаваться таблицы, если их нет

This commit is contained in:
Данил 2024-10-08 20:15:20 +03:00
parent 9443efae46
commit a6c2dc7b06
3 changed files with 18 additions and 0 deletions

View file

@ -6,6 +6,8 @@ const save_fiat = require('./save_fiat');
const save_crypto = require('./save_crypto');
async function main() {
await require('../shared/database/src/create_table')();
const config_schedule = config['currency']['collecting']['schedule'];
if (!config_schedule) throw new Error('The crontab schedule is not set');
if (!cron.isValidCron(config_schedule, { alias: true }))