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

Quite Confusing Delay Schedule #3

Closed
alur222 opened this issue Oct 24, 2017 · 4 comments
Closed

Quite Confusing Delay Schedule #3

alur222 opened this issue Oct 24, 2017 · 4 comments
Labels

Comments

@alur222
Copy link

alur222 commented Oct 24, 2017

Hi Max, good job!

But can you please elaborate on this?:

The date object will be updated in the order that is specified.
 For example, if you set the job to run in 1 year, an on year 2037, the year will be 2037. 
However, if you set the job to run on year 2037, and in 1 year, the year will be 2038.

Do u mean that these jobs are not the same?
1

Jobs.add("sendReminderEmail", "john@smith.com", "The future is here!", {
    in: {
        days: 1,
        hours: 13
    }, 
    on: {
        minute: 13,
        year: 2037
    }
});

2

Jobs.add("sendReminderEmail", "john@smith.com", "The future is here!", {
    on: {
        days: 1,
        hours: 13
    }, 
    in: {
        minute: 13,
        year: 2037
    }
});

Didn't try this though but it confused me while reading the instructions.

Thanks in advance.

@msavin
Copy link
Owner

msavin commented Oct 24, 2017

Hey man - thanks for the interest.

In the example that you used, it would be the same because there are no conflicting options.

However, in this case, there year would become 2037.

Jobs.add("sendReminderEmail", "john@smith.com", "The future is here!", {
    on: {
        days: 1,
        hours: 13,
        year: 2036
    }, 
    in: {
        minute: 13,
        year: 1 
    }
});

But in this one, it would be 2036:

Jobs.add("sendReminderEmail", "john@smith.com", "The future is here!", {
    in: {
        minute: 13,
        year: 1 
    },
    on: {
        days: 1,
        hours: 13,
        year: 2036
    }, 
});

However, it maybe best to omit that part from the instructions. The thing is, I'm planning to enable functions as an input, so that's where it might get tricky:

Jobs.add("sendReminderEmail", "john@smith.com", "The future is here!", {
    in: {
        minute: 13,
        year: 1 
    },
    on: {
        days: 1,
        hours: 13,
        year: function () {
            if (x) { 
                return 2037
            }
        }
    }, 
});

@alur222
Copy link
Author

alur222 commented Oct 25, 2017

Thanks! It's clear now. 👍

@luixal
Copy link

luixal commented Oct 25, 2017

Hey, I think the package is no longer supported, but I haven't find anything better for this than using LaterJS.

Supporting that may be a different package? SteveJobs-meteor-jobs-queue-laterjs?

@msavin
Copy link
Owner

msavin commented Feb 8, 2018

@luixal not sure which package we are discussing - but maybe this is relevant: Jobs.run now supports a date field so you can plug in any library in there.

Going to close this ticket out as it seems old/resolved - but feel free to open a new one.

@msavin msavin closed this as completed Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants