Advertisement
Guest User

Untitled

a guest
May 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Cron('* * * * *')
  2.     public async test() {
  3.     console.log(this)
  4. }
  5.  
  6.  
  7. import { CronJob } from 'cron';
  8.  
  9. export function Cron(pattern: string) {
  10.   return (t: Object, p: string, d: PropertyDescriptor) => {
  11.     new CronJob(pattern, () => d.value(), null, true, 'America/Los_Angeles');
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement