refs #4823 Now supports db drops
This commit is contained in:
parent
d3f9216f36
commit
a6da4feb1f
19
floriday.js
19
floriday.js
|
@ -22,14 +22,15 @@ class Floriday {
|
|||
}
|
||||
|
||||
async tryConn() {
|
||||
try {
|
||||
utils.sleep(env.DB_TIMEOUT_RECONECT);
|
||||
await checkConn();
|
||||
await this.schedule();
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
while (true)
|
||||
try {
|
||||
utils.warning(new Error('Waiting for the database to respond...'));
|
||||
await utils.sleep(env.DB_TIMEOUT_RECONECT);
|
||||
await checkConn();
|
||||
await this.schedule();
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
}
|
||||
|
||||
async schedule () {
|
||||
|
@ -59,7 +60,7 @@ class Floriday {
|
|||
// Continuar con todo lo que haga falta realizar en la rutina
|
||||
|
||||
} catch (err) {
|
||||
utils.criticalError(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
utils.js
8
utils.js
|
@ -253,6 +253,9 @@ export async function syncSequence(current = 0, model = null , maximumSequenceNu
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync the suppliers
|
||||
*/
|
||||
export async function syncSuppliers(){
|
||||
let spinner = ora('Preparing to load suppliers...').start();
|
||||
try {
|
||||
|
@ -301,7 +304,7 @@ export async function syncSuppliers(){
|
|||
}
|
||||
|
||||
/**
|
||||
* Sync the connections in Floriday
|
||||
* Create the connections in Floriday
|
||||
*/
|
||||
export async function syncConnections(){
|
||||
await deleteConnections();
|
||||
|
@ -343,6 +346,9 @@ export async function syncConnections(){
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync the connections in Floriday
|
||||
*/
|
||||
export async function syncTradeItems(){
|
||||
const spinner = ora(`Syncing trade items...`).start();
|
||||
const suppliers = await models.supplier.findAll({
|
||||
|
|
Loading…
Reference in New Issue