Skip to content

Commit

Permalink
extract max conventions to sync with pe into env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Jun 28, 2023
1 parent 8fffd51 commit e81e1bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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

0 comments on commit e81e1bf

Please sign in to comment.