Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /panda-server/pandaserver/daemons/scripts/async_request_daemon.py was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 """
0002 Daemon wrapper for async request processing on panda-server machines (service_name="server").
0003 For JEDI machines, use pandajedi/jedidog/AsyncRequestWatchDog.py which calls the same processor.
0004 """
0005 
0006 import sys
0007 
0008 from pandacommon.pandautils.thread_utils import GenericThread
0009 
0010 from pandaserver.asyncprocess import processor
0011 from pandaserver.config import panda_config
0012 
0013 
0014 def main(argv=tuple(), tbuf=None, **kwargs):
0015     requester_id = GenericThread().get_full_id(__name__, sys.modules[__name__].__file__)
0016 
0017     if tbuf is None:
0018         from pandaserver.taskbuffer.TaskBuffer import taskBuffer
0019 
0020         taskBuffer.init(
0021             panda_config.dbhost,
0022             panda_config.dbpasswd,
0023             nDBConnection=1,
0024             useTimeout=True,
0025             requester=requester_id,
0026         )
0027     else:
0028         taskBuffer = tbuf
0029 
0030     processor.run(service_name="server", tbuf=taskBuffer)
0031 
0032     if tbuf is None:
0033         taskBuffer.cleanup(requester=requester_id)
0034 
0035 
0036 if __name__ == "__main__":
0037     main(argv=sys.argv)