Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
bst_claimsync: fix circular import
Browse files Browse the repository at this point in the history
Signed-off-by: Samuele Kaplun <[email protected]>
  • Loading branch information
kaplun committed Nov 10, 2017
1 parent 2d34ba7 commit fe90083
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bibtasklets/bst_claimsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from invenio.config import CFG_REDIS_HOST_LABS, CFG_TMPSHAREDDIR
from invenio.bibformat_elements.bfe_INSPIRE_enhanced_marcxml import get_hepname_id, get_personid_canonical_id
from invenio.bibsched_tasklets.bst_prodsync import run_on_slave_db
from invenio.bibtask import write_message
from invenio.dbquery import run_sql

Expand Down Expand Up @@ -38,14 +37,15 @@ def bst_claimsync():
Note2: in order to set the lastrun to a particular date edit
the file CFG_TMPSHAREDDIR/claimsync_lastrun.txt.
"""
from invenio.bibsched_tasklets.bst_prodsync import run_ro_on_slave_db
r = redis.StrictRedis.from_url(CFG_REDIS_HOST_LABS)
if r.llen(REDIS_KEY) != 0:
write_message("Skipping prodsync: Redis queue is not yet empty")
return
now = strftime('%Y-%m-%d %H:%M:%S')
lastrun = get_lastrun()
write_message("Syncing claims modified since %s" % lastrun)
with run_on_slave_db():
with run_ro_on_slave_db():
claims = run_sql("""
SELECT personid, bibrec, name, flag
FROM aidPERSONIDPAPERS
Expand Down

0 comments on commit fe90083

Please sign in to comment.