Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Update cron schedule to run every minute and set temporary_employee_i…
Browse files Browse the repository at this point in the history
…d based on condition
  • Loading branch information
csulit committed Sep 29, 2023
1 parent a0f67c7 commit 1393761
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/users/services/cron/user-update.cron.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Cron, CronExpression } from '@nestjs/schedule';
import { Cron } from '@nestjs/schedule';
import { InjectKysely } from 'nestjs-kysely';
import { DB } from 'src/common/types';
import { UsersApiService } from '../users.api.service';
Expand All @@ -18,7 +18,7 @@ export class UserUpdateCronService {
@InjectKysely() private readonly pgsql: DB,
) {}

@Cron(CronExpression.EVERY_5_MINUTES)
@Cron('0 */1 * * * *')
async handleCron() {
try {
const outdatedUsers = await this.pgsql
Expand Down Expand Up @@ -68,6 +68,7 @@ export class UserUpdateCronService {
: hrbpEmail,
position,
temporary_propelauth_user_id: false,
temporary_employee_id: sr ? false : true,
updated_via_cron_erp_hr: true,
})
.returning(['users.email'])
Expand Down

0 comments on commit 1393761

Please sign in to comment.