Skip to content

Commit c561fde

Browse files
committed
feat: example role job
1 parent acbc666 commit c561fde

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/jobs/RoleJob.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import RoleService from 'controllers/Role/service'
2+
import cron from 'node-cron'
3+
import ConstRoles from 'constants/ConstRoles'
4+
5+
// Run this job every 30 minutes
6+
const GetRoleTask = cron.schedule('30 * * * *', async () => {
7+
const data = await RoleService.getOne(ConstRoles.ID_UMUM)
8+
console.log('Running task check get role by id', { data })
9+
})
10+
11+
export { GetRoleTask }

0 commit comments

Comments
 (0)