def cleanup_ghosts(conn=None):
 conn = (conn if conn else get_current_connection())
 for worker in Worker.all(connection=conn):
  if (conn._ttl(worker.key) == (-1)):
   ttl = worker.default_worker_ttl
   conn.expire(worker.key, ttl)
   logger.info(u'Marked ghosted worker {0} to expire in {1} seconds.'.format(worker.name, ttl))

def cleanup_ghosts ( conn = None ) : conn = ( conn if conn else get_current_connection ( ) ) for worker in Worker . all ( connection = conn ) : if ( conn . _ttl ( worker . key ) == ( - 1 ) ) : ttl = worker . default_worker_ttl conn . expire ( worker . key , ttl ) logger . info ( u'Marked ghosted worker {0} to expire in {1} seconds.' . format ( worker . name , ttl ) )
rq versions < 0 .