Skip to content

Commit

Permalink
✨ Ajout d'un cron pour l'attribution des GRD aux raccordements manqua…
Browse files Browse the repository at this point in the history
…nts (#1924)
  • Loading branch information
benjlevesque committed Jul 4, 2024
1 parent d66e5c0 commit 1f7b9f4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 127 deletions.
4 changes: 4 additions & 0 deletions cron.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"command": "0 8 * * 0 ./packages/applications/scheduled-tasks/mettre-à-jour-gestionnaire-réseau.sh",
"size": "M"
},
{
"command": "0 8 * * 1-5 ./packages/applications/scheduled-tasks/attribuer-grd.sh",
"size": "M"
},
{
"command": "0 1 * * * ./packages/applications/scheduled-tasks/relancer-abandon-sans-preuve.sh",
"size": "M"
Expand Down
19 changes: 19 additions & 0 deletions packages/applications/scheduled-tasks/attribuer-grd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash -l

if [ -z $EVENT_STORE_CONNECTION_STRING ]
then
echo "Connection is missing!"
exit 1
fi

if [ -z $ORE_ENDPOINT ]
then
echo "Ore endpoint is missing!"
exit 1
fi

echo "Launching job [ATTRIBUER GRD]"

npm run start:start:attribuer-grd -w @potentiel-applications/scheduled-tasks

exit 0
1 change: 0 additions & 1 deletion packages/applications/scheduled-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"build": "tsc",
"start:attribuer-grd": "node ./dist/raccordement/attribuer-gestionnaire-réseau",
"start:maj-grd-des-projets-avec-raccordement": "node ./dist/raccordement/maj-gestionnaire-réseau-des-projets-avec-raccordement",
"start:relancer-abandon-sans-preuve": "node ./dist/abandon/relancer-abandon-sans-preuve",
"start:déplacer-fichiers-vers-bucket-secnum": "node ./dist/déplacer-fichiers-vers-bucket-secnum",
"start:créer-backup": "node ./dist/backup/créer-backup",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ registerRéseauQueries({
}

if (projetsSansGestionnaire.length) {
const pourcentageProjetsNonTrouvés = Math.round(
(projetsSansGestionnaireTrouvés / projetsSansGestionnaire.length) * 100,
);
getLogger().info(
`Sur ${projetsSansGestionnaire.length} projets classés sans raccordement, nous n'avons pas pu attribuer de GRD à ${pourcentageProjetsNonTrouvés} % d'entre eux`,
`Sur ${projetsSansGestionnaire.length} projets classés sans raccordement, nous n'avons pas pu attribuer de GRD à ${projetsSansGestionnaireTrouvés} d'entre eux`,
);
}

Expand Down

This file was deleted.

0 comments on commit 1f7b9f4

Please sign in to comment.