Skip to content

Commit

Permalink
add try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarkowsky committed Mar 15, 2024
1 parent a0f923e commit 83238f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions express-api/src/utilities/cronJobs/syncKeycloakRoles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ const cronSyncKeycloakRoles = () => {
const cronSchedule = '*/10 * * * *'; // Every 10 minutes
cron.schedule(cronSchedule, async () => {
logger.info(`Starting Sync Keycloak Roles routine at ${new Date().toISOString()}.`);
await KeycloakService.syncKeycloakRoles();
logger.info(`Sync Keycloak Roles routine complete at ${new Date().toISOString()}.`);
try {
await KeycloakService.syncKeycloakRoles();
logger.info(`Sync Keycloak Roles routine complete at ${new Date().toISOString()}.`);
} catch (e) {
logger.warn(e.message);
}
});
};

Expand Down

0 comments on commit 83238f0

Please sign in to comment.