-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve #56 #61
base: main
Are you sure you want to change the base?
resolve #56 #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quelques petits retours, mais sinon très cool 😄 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top, c'est quasi prêt 😄 ! Il faut juste que je check que ça marche avant de déployer celui-là sinon ça risque de crasher le serveur si mongodump est pas installé 😬...
@@ -24,4 +24,4 @@ | |||
"exclude": [ | |||
"node_modules" | |||
] | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi y'a cette modif 🤔 ? L'eslint devrait garder les lignes vide à la fin normalement, non ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai enfin compris. J'ai ajouté ces lignes à mon .vscode
dans website
"eslint.workingDirectories": [
{
"mode": "auto"
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top, quelques petits retours et on est bon 😄 !
|
||
|
||
export const dumpDatabaseJob = CronJob.from({ | ||
start: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi pas le start directement 🤔 ?
export const dumpDatabaseJob = CronJob.from({ | ||
start: false, | ||
cronTime: "0 0 4 * * *", | ||
onComplete: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du coup y'a pas besoin de cette propriété, si ?
@@ -8,6 +8,9 @@ import APIHandler from "@/api"; | |||
import StaticHandler from "@/static"; | |||
import UploadHandler from "@/upload"; | |||
import PageHandler from "@/page"; | |||
import * as cron from "@/cronjob"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si tu les start directement, tu peux juste import le fichier
import "@/cronjob";
const folderName = `../dumps/${ dumpDate }`; | ||
await pfs.mkdir(folderName, { recursive: true }); | ||
|
||
const child = cs.spawn("mongodump", ["--db", "sgnw", "--out", `../dumps/${ dumpDate }`], { stdio: "inherit" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça serait peut être pas mal de mettre le path vers mongodump dans le .env
, je suis pas sûr qu'on veuille forcément le mettre dans le Path 🤔
dirs.forEach(async (dir) => { | ||
const [day, month, year] = dir.split("-").map(Number); | ||
const dumpDate = new Date(year, month - 1, day); | ||
const Difference_In_Days = Math.floor((currentDate.getTime() - dumpDate.getTime()) / (1000 * 3600 * 24)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il y a le package date-fns
qui est installé, je sais pas si c'est worth, mais jette un oeil 🤔
Added automatic dumps of the database up to 30 days of data