Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-11 08:41:05

0001 #!/usr/bin/env python
0002 # Licensed under the Apache License, Version 2.0 (the "License");
0003 # you may not use this file except in compliance with the License.
0004 # You may obtain a copy of the License at
0005 # http://www.apache.org/licenses/LICENSE-2.0
0006 #
0007 # Authors:
0008 # - Paul Nilsson, paul.nilsson@cern.ch, 2018
0009 
0010 
0011 def allow_loopingjob_detection():
0012     """
0013     Should the looping job detection algorithm be allowed?
0014     The looping job detection algorithm finds recently touched files within the job's workdir. If a found file has not
0015     been touched during the allowed time limit (see looping job section in util/default.cfg), the algorithm will kill
0016     the job/payload process.
0017 
0018     :return: boolean.
0019     """
0020 
0021     return True
0022 
0023 
0024 def remove_unwanted_files(workdir, files):
0025     """
0026     Remove files from the list that are to be ignored by the looping job algorithm.
0027 
0028     :param workdir: working directory (string). Needed in case the find command includes the workdir in the list of
0029     recently touched files.
0030     :param files: list of recently touched files (file names).
0031     :return: filtered files list.
0032     """
0033 
0034     _files = []
0035     for _file in files:
0036         if not (workdir == _file or
0037                 "prmon" in _file or
0038                 "pilotlog" in _file or
0039                 ".lib.tgz" in _file or
0040                 ".py" in _file or
0041                 "pandaJob" in _file):
0042             _files.append(_file)
0043 
0044     return _files