<s> import logging <EOL> from google . appengine . runtime import DeadlineExceededError <EOL> from . import utils <EOL> logger = logging . getLogger ( __name__ ) <EOL> class DefferedTask ( object ) : <EOL> name = lambda self : self . __class__ . __name__ <EOL> def __call__ ( self , cursor = None ) : <EOL> if cursor : <EOL> logger . debug ( "<STR_LIT>" <EOL> % ( self . name , self . cursor ) ) <EOL> else : <EOL> logger . debug ( "<STR_LIT>" % self . name ) <EOL> utils . flush_logs ( ) <EOL> try : <EOL> self . cursor = cursor <EOL> self . job ( ) <EOL> except DeadlineExceededError : <EOL> logger . debug ( <EOL> "<STR_LIT>" <EOL> % ( self . name , self . cursor ) <EOL> ) <EOL> self . __call__ ( self . cursor ) </s>
