<s> import random <EOL> import time <EOL> from huey import crontab <EOL> from config import huey <EOL> @ huey . task ( ) <EOL> def count_beans ( num ) : <EOL> print ( '<STR_LIT>' % num ) <EOL> return '<STR_LIT>' % num <EOL> @ huey . periodic_task ( crontab ( minute = '<STR_LIT>' ) ) <EOL> def every_five_mins ( ) : <EOL> print ( '<STR_LIT>' ) <EOL> @ huey . task ( retries = <NUM_LIT:3> , retry_delay = <NUM_LIT:10> ) <EOL> def try_thrice ( msg ) : <EOL> print ( '<STR_LIT>' % msg ) <EOL> if random . randint ( <NUM_LIT:1> , <NUM_LIT:3> ) == <NUM_LIT:1> : <EOL> print ( '<STR_LIT:OK>' ) <EOL> else : <EOL> print ( '<STR_LIT>' ) <EOL> raise Exception ( '<STR_LIT>' ) <EOL> @ huey . task ( ) <EOL> def slow ( n ) : <EOL> time . sleep ( n ) <EOL> print ( '<STR_LIT>' % n ) </s>
