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

use now() instead of 'now' #74

Merged
merged 1 commit into from
Jan 12, 2015
Merged

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Jan 12, 2015

The argument 'now' is evaluated when the statement is prepared, not when
it is executed. So the timestamp in the insert_job query will be stale
after the first execution.

Switching it to now() ensures that it is always evaluated when the query
is executed.

See bgentry/que-go#1 for more details.

Not sure if you think this needs a test or not, but you'd probably have a better idea of how you want that to look if so.

P.S. I made a golang port of Que :) https://github.com/bgentry/que-go

The argument 'now' is evaluated when the statement is prepared, not when
it is executed. So the timestamp in the insert_job query will be stale
after the first execution.

Switching it to now() ensures that it is always evaluated when the query
is executed.

See bgentry/que-go#1 for more details.
@bgentry
Copy link
Contributor Author

bgentry commented Jan 12, 2015

Not sure what this failed test is about but it doesn't look related: https://travis-ci.org/chanks/que/jobs/46681646

chanks added a commit that referenced this pull request Jan 12, 2015
@chanks chanks merged commit 7de000b into que-rb:master Jan 12, 2015
@chanks
Copy link
Collaborator

chanks commented Jan 12, 2015

I saw! Thanks for the blog post, it was very complementary.

I actually noticed this issue when I was looking at your port the other day, and tried to reproduce the 'now'/now() issue with the Que gem and couldn't do it. Regardless, I have no objection to using now().

And yeah, there are occasional test failures on Travis that I've never been able to reproduce on my machine, and that's one of them. I wouldn't worry about it.

@bgentry bgentry deleted the use-now-function branch January 12, 2015 01:29
@bgentry
Copy link
Contributor Author

bgentry commented Jan 12, 2015

Thanks! ✌️

@joevandyk
Copy link
Contributor

@chanks could it be that the prepared statements aren't working as expected?

@chanks
Copy link
Collaborator

chanks commented Jan 13, 2015

Possibly? I'll open an issue to remind myself to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants