#NEWLINE# def ping( self , before_commit_callback = None ) : #NEWLINE# #INDENT# '\n        Keep-alive for the farmer. Validation can take a long time, so\n        we just want to know if they are still there.\n\n        ' #NEWLINE# pingtime = datetime . utcnow ( ) #NEWLINE# farmer = self . lookup ( ) #NEWLINE# delta = ( pingtime - farmer . last_seen ) #NEWLINE# time_limit = ( delta . seconds >= app . config [ 'MAX_PING' ] ) #NEWLINE# if time_limit : #NEWLINE# #INDENT# farmer . last_seen = pingtime #NEWLINE# if before_commit_callback : #NEWLINE# #INDENT# before_commit_callback ( ) #NEWLINE# #UNINDENT# db . session . commit ( )