FIX timestamp handling

This commit is contained in:
boyska 2015-02-24 15:53:14 +01:00
parent b5a100f9e7
commit ae9cb38bbe
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9
2 changed files with 4 additions and 1 deletions

View file

@ -112,6 +112,9 @@ class Monitor(ParentedLet):
except: except:
logging.exception("Could not generate " logging.exception("Could not generate "
"an alarm from timespec {}".format(timespec)) "an alarm from timespec {}".format(timespec))
if when is None:
# expired
return
delta = when - now delta = when - now
assert delta.total_seconds() > 0 assert delta.total_seconds() > 0
self.log.info('Will run after %d seconds' % delta.total_seconds()) self.log.info('Will run after %d seconds' % delta.total_seconds())

View file

@ -17,5 +17,5 @@ def singlealarm_receive(form):
return { return {
'kind': 'single', 'kind': 'single',
'nick': form.nick.data, 'nick': form.nick.data,
'timestamp': form.dt.data.strftime('%s') 'timestamp': int(form.dt.data.strftime('%s'))
} }