Skip to content
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

sortir le nombre max de convention à synchroniser avec pe en variable d'environnement #384

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ SIRENE_REPOSITORY=IN_MEMORY
# NANO_ID | DETERMINIST
SHORT_LINK_ID_GENERATOR_GATEWAY=NANO_ID

MAX_CONVENTIONS_TO_SYNC_WITH_PE=50

# ------- for front ---------

VITE_CRISP_WEBSITE_ID=""
Expand Down
8 changes: 8 additions & 0 deletions back/src/adapters/primary/config/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export class AppConfig {
});
}

public get maxConventionsToSyncWithPe() {
return parseInt(
this.throwIfNotDefinedOrDefault("MAX_CONVENTIONS_TO_SYNC_WITH_PE", "50"),
);
}

// == Data repositories ==

public get repositories() {
Expand Down Expand Up @@ -285,6 +291,7 @@ export class AppConfig {
"POLE_EMPLOI_AUTHENTIFICATION_CANDIDAT_URL",
);
}

public get peEnterpriseUrl(): AbsoluteUrl {
return this.throwIfNotAbsoluteUrl("POLE_EMPLOI_ENTREPRISE_URL");
}
Expand Down Expand Up @@ -356,6 +363,7 @@ export class AppConfig {
public get backofficeUsername() {
return this.throwIfNotDefinedOrDefault("BACKOFFICE_USERNAME");
}

public get backofficePassword() {
return this.throwIfNotDefinedOrDefault("BACKOFFICE_PASSWORD");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const executeUsecase = async () => {
uowPerformer,
httpPoleEmploiGateway,
timeGateway,
50,
config.maxConventionsToSyncWithPe,
);

return resyncOldConventionsToPeUsecase.execute();
Expand Down