Skip to content
Snippets Groups Projects
Commit 313a0139 authored by Zitnik, Anze's avatar Zitnik, Anze
Browse files

Logging all exceptions

parent 1e714e73
No related branches found
No related tags found
No related merge requests found
......@@ -24,8 +24,8 @@ remove_jobs(scheduler)
# TODO: Change cron expression and repeat value for production verion.
# Should probably be "0 0 * * * ".
scheduler.cron(
'* * * * * ',
func=wazuh_evidence_collector.run_collector,
'* * * * * ',
func=wazuh_evidence_collector.main,
args=[],
repeat=None,
queue_name=CONSTANTS['redis']['queue'],
......
......@@ -49,6 +49,12 @@ def get_tool_id():
return version
def main():
try:
run_collector()
except BaseException as e:
LOGGER.exception("Exception caught in run_collector()")
# Wrapper function that runs all the checks (for every manager/agent)
def run_collector():
......@@ -201,4 +207,4 @@ def generate_evidence(wc, es, agent):
return create_evidence(get_id(), "evidence_collector_service", get_tool_id(), raw_evidence, resource)
if __name__ == "__main__":
run_collector()
\ No newline at end of file
main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment