run.py
def callback_reminder_clock(context: CallbackContext, out: bool = False) -> None:
    """Handle callback: a clock in/out reminder schedule using job queue."""
    ses = apollodb.UserQuery(apollodb.Session())
    us = ses.get_reminder()
    clock_string = "clockin_"
    if out:
        clock_string = "clockout_"
    for u in us:
        max_half_hour_delay = random.randint(0, 60 * 29)
        logging.info(
            f"{clock_string}: Adding a {str(max_half_hour_delay)} second delay for {str(u.userid)}"
        )
        callback_clock_function = partial(callback_clock, out=False)
        if out:
            callback_clock_function = partial(callback_clock, out=True)
        context.job_queue.run_once(
            callback_clock_function,
            max_half_hour_delay,
            context=u,
            name=clock_string + str(u.userid),
        )
Handle callback: a clock in/out reminder schedule using job queue.
Handle callback: a clock in/out reminder schedule using job queue.
Handle callback : a clock in / out reminder schedule using job queue .
def callback_reminder_clock(context: CallbackContext, out: bool = False) -> None:
    ses = apollodb.UserQuery(apollodb.Session())
    us = ses.get_reminder()
    clock_string = "clockin_"
    if out:
        clock_string = "clockout_"
    for u in us:
        max_half_hour_delay = random.randint(0, 60 * 29)
        logging.info(
            f"{clock_string}: Adding a {str(max_half_hour_delay)} second delay for {str(u.userid)}"
        )
        callback_clock_function = partial(callback_clock, out=False)
        if out:
            callback_clock_function = partial(callback_clock, out=True)
        context.job_queue.run_once(
            callback_clock_function,
            max_half_hour_delay,
            context=u,
            name=clock_string + str(u.userid),
        )
def callback_reminder_clock ( context : CallbackContext , out : bool = False ) -> None : ses = apollodb . UserQuery ( apollodb . Session ( ) ) us = ses . get_reminder ( ) clock_string = "clockin_" if out : clock_string = "clockout_" for u in us : max_half_hour_delay = random . randint ( 0 , 60 * 29 ) logging . info ( f"{clock_string}: Adding a {str(max_half_hour_delay)} second delay for {str(u.userid)}" ) callback_clock_function = partial ( callback_clock , out = False ) if out : callback_clock_function = partial ( callback_clock , out = True ) context . job_queue . run_once ( callback_clock_function , max_half_hour_delay , context = u , name = clock_string + str ( u . userid ) , )
Handle callback: a clock in/out reminder schedule using job queue.
Handle callback : a clock in / out reminder schedule using job queue .
"""Handle callback: a clock in/out reminder schedule using job queue."""
context
CallbackContext
out
bool