#NEWLINE# def __call__( self ) : #NEWLINE# #INDENT# db = current . db #NEWLINE# s3db = current . s3db #NEWLINE# request = current . request #NEWLINE# now = request . utcnow #NEWLINE# month_past = ( now - datetime . timedelta ( weeks = 4 ) ) #NEWLINE# table = s3db . scheduler_run #NEWLINE# db ( ( table . start_time < month_past ) ) . delete ( ) #NEWLINE# table = s3db . sync_log #NEWLINE# db ( ( table . timestmp < month_past ) ) . delete ( ) #NEWLINE# osjoin = os . path . join #NEWLINE# osstat = os . stat #NEWLINE# osremove = os . remove #NEWLINE# folder = osjoin ( global_settings . applications_parent , request . folder , 'sessions' ) #NEWLINE# month_past_u = time . mktime ( month_past . timetuple ( ) ) #NEWLINE# for file in os . listdir ( folder ) : #NEWLINE# #INDENT# filepath = osjoin ( folder , file ) #NEWLINE# status = osstat ( filepath ) #NEWLINE# if ( status . st_mtime < month_past_u ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# osremove ( filepath ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass