Skip to content

Commit

Permalink
record start time before starting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Timmerman committed Oct 24, 2017
1 parent 8f0d50f commit dadb666
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions bin/sync_django_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ def main():
try:
last_timestamp = read_timestamp(SYNC_TIMESTAMP_FILENAME)
except Exception:
_log.warning("Something broke reading the timestamp from %s" % SYNC_TIMESTAMP_FILENAME)
_log.warning("Something broke reading the timestamp from %s", SYNC_TIMESTAMP_FILENAME)
last_timestamp = "201707230000Z"
_log.warning("We will resync from a while back : %s" % (last_timestamp,))
_log.warning("We will resync from a while back : %s", last_timestamp)

_log.info("Using timestamp %s" % (last_timestamp))
_log.info("Using timestamp %s", last_timestamp)
# record starttime before starting, and take a 10 sec safety buffer so we don't get gaps where users are approved
# in between the requesting of modified users and writing out the start time
start_time = datetime.now() - 10
_log.info("startime %s", start_time)

try:
parent_pid = os.fork()
Expand Down Expand Up @@ -135,7 +139,7 @@ def main():

if not result:
if not opts.options.start_timestamp:
(_, ldap_timestamp) = convert_timestamp(datetime.now())
(_, ldap_timestamp) = convert_timestamp(start_time)
if not opts.options.dry_run:
write_timestamp(SYNC_TIMESTAMP_FILENAME, ldap_timestamp)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from vsc.install.shared_setup import ag, jt

PACKAGE = {
'version': '1.0.9',
'version': '1.0.10',
'author': [ag, jt],
'maintainer': [ag, jt],
'tests_require': ['mock'],
Expand Down

0 comments on commit dadb666

Please sign in to comment.