Skip to content

Commit

Permalink
make botAgentEmail optional
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Nov 22, 2024
1 parent 65e731c commit b8d9373
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/src/core/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ParamsOfBootstrapCore = {
doPerformCacheInitialization: boolean;
externalSoftwareDataOrigin: ExternalDataOrigin;
initializeSoftwareFromSource: boolean;
botAgentEmail: string;
botAgentEmail: string | undefined;
};

export type Context = {
Expand Down Expand Up @@ -121,6 +121,7 @@ export async function bootstrapCore(
if (initializeSoftwareFromSource) {
if (externalSoftwareDataOrigin === "HAL") {
console.log(" ------ Feeding database with HAL software started ------");
if (!botAgentEmail) throw new Error("No bot agent email provided");
const importHAL = importFromHALSource(dbApi);
try {
await importHAL(botAgentEmail);
Expand Down
2 changes: 1 addition & 1 deletion api/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const zConfiguration = z.object({
"externalSoftwareDataOrigin": z.enum(["wikidata", "HAL"]).optional(),
"databaseUrl": z.string(),
"initializeSoftwareFromSource": z.boolean(),
"botAgentEmail": z.string()
"botAgentEmail": z.string().optional()
});

const getJsonConfiguration = () => {
Expand Down
2 changes: 1 addition & 1 deletion api/src/rpc/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function startRpcService(params: {
redirectUrl?: string;
databaseUrl: string;
initializeSoftwareFromSource: boolean;
botAgentEmail: string;
botAgentEmail?: string;
}) {
const {
redirectUrl,
Expand Down

0 comments on commit b8d9373

Please sign in to comment.