Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set time from config service to decorator #24

grigori-gru opened this issue May 31, 2019 · 3 comments


None yet
2 participants
Copy link

commented May 31, 2019

Is it possible to set time to decorator from configService which I use as dependency in my job module, for example this way:

export class JobService extends NestSchedule {
    private readonly logger = new Logger(;

        private readonly configSerice: ConfigService,
    ) {

    @Cron('10 0 * * *')
    async saveVoteResult2Db() {
        this.logger.log('Starting daily cronjob!!!');

    async saveToRedis() {
        this.logger.debug('Data is synced with redis');

This comment has been minimized.

Copy link

commented May 31, 2019

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.


This comment has been minimized.

Copy link

commented Jun 4, 2019

The this context is different between decorator and function, not use this in decorator

@miaowing miaowing added the question label Jun 4, 2019


This comment has been minimized.

Copy link

commented Jun 5, 2019

Thanks, but how should I use it in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.