implementing cron

This commit is contained in:
daniel muniz
2024-07-24 19:42:14 -03:00
parent 7f59ce78bc
commit 5fbeb896c5
3 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
const { exec } = require("node:child_process")
class UpdateCategoriesUseCase {
execute() {
return new Promise((_, reject) => {
exec(`bin/gcf1dbmng.sh etc urldb_update`, { cwd: '/usr/local/gcf1' }, (error, stdout, stderr) => {
if (error) {
console.error(error);
reject(error);
return;
}
console.log(stdout)
});
});
}
}
module.exports = { UpdateCategoriesUseCase }