def create_event(task, new_datetime): e = SchEventDB.create_or_update(task, new_datetime, "planned") if e: logging.warning("Planned %s at %s" % (e, new_datetime + DELTA_LOCAL_UTC)) sched.add_date_job(emit_event, new_datetime + DELTA_LOCAL_UTC, [e]) else: logging.error("Exists %s at %s:%s" % (task["_id"], task["time_h"], task["time_m"]))
def create_event(task, new_datetime): e = SchEventDB.create_or_update(task, new_datetime, 'planned') if e: logging.warning("Planned %s at %s" % (e, new_datetime + DELTA_LOCAL_UTC)) sched.add_date_job(emit_event, new_datetime + DELTA_LOCAL_UTC, [e]) else: logging.error("Exists %s at %s:%s" % (task['_id'], task['time_h'], task['time_m']))