remove comments
This commit is contained in:
parent
0eed231dce
commit
f79662beb6
5
index.js
5
index.js
|
@ -1,7 +1,6 @@
|
|||
import moment from 'moment';
|
||||
import { getClientToken } from './utils.js';
|
||||
|
||||
// Check the existence of the .env file
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
|
||||
|
@ -9,12 +8,9 @@ import models from './models/index.js';
|
|||
|
||||
let AccessToken = await getClientToken(models);
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
let tokenValue = AccessToken[0];
|
||||
let tokenExpirationDate = AccessToken[1];
|
||||
|
||||
try {
|
||||
// Every 30 sec query the database
|
||||
setInterval(async () => {
|
||||
console.log('Querying the API to check for new data...');
|
||||
console.log('Current token expiration date: ', tokenExpirationDate);
|
||||
|
@ -22,7 +18,6 @@ try {
|
|||
if (moment().isAfter(tokenExpirationDate)) {
|
||||
console.log('Token expired, getting a new one...');
|
||||
AccessToken = await getClientToken(models);
|
||||
tokenValue = AccessToken[0];
|
||||
tokenExpirationDate = AccessToken[1];
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ let models = {
|
|||
characteristics: characteristics(sequelize),
|
||||
};
|
||||
|
||||
// Force sync the models if the enviroment variable "FORCE_SYNC" is set to true
|
||||
if (process.env.FORCE_SYNC === 'true') {
|
||||
console.log('Syncing the models...');
|
||||
await sequelize.sync({ force: true });
|
||||
|
|
Loading…
Reference in New Issue