Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions queue_job/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
of running Odoo is obviously not for production purposes.
"""

import datetime
import logging
import os
import selectors
Expand Down Expand Up @@ -181,15 +180,10 @@ def _channels():
)


def _datetime_to_epoch(dt):
def _odoo_now():
# important: this must return the same as postgresql
# EXTRACT(EPOCH FROM TIMESTAMP dt)
return (dt - datetime.datetime(1970, 1, 1)).total_seconds()


def _odoo_now():
dt = datetime.datetime.utcnow()
return _datetime_to_epoch(dt)
return time.time()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the comment that says it must do the same as the postgres equivalent, though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, done 👍



def _connection_info_for(db_name):
Expand Down