h dZddlmZddlmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZmZmZdd lmZeeZGd d eeZd S) u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see ) getLogger)expect MessageSource MessageSink) MessageType)recurring_check) check_lock)MalwareDetachedDirCleaner)OutdatedHistoryCleanerOutdatedHitsCleanerOutdatedScansCleaner)UncompletedScansCleanercdeZdZeeeegZdZdZ dZ e e j dZdZdS)MrProperc0d|_d|_g|_dSN)_loop_sink_tasks)selfs K/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/mr_proper.py__init__zMrProper.__init__7s   c K||_||_|jD]j}|j|jt td|j|j |j kdS)NT)check_period_firstcheck_lock_period lock_file) rrCLEANERSrappend create_taskrr PERIOD LOCK_FILEcleanup)rloopsinkcleaners r create_sourcezMrProper.create_source<s  }  G K   &&'O"+/*1.")"3  o ''))      rc KdSr)rr$s r create_sinkzMrProper.create_sinkKs  rcpKtjd{VtddS)NzDetached scans checked)rr#loggerinfo)r_s rcheck_detached_scanszMrProper.check_detached_scansNs@%-///////// ,-----rcjK|jD]}||jD] }|d{V dSr)rcancel)rtasks rshutdownzMrProper.shutdownSsVK  D KKMMMMK  DJJJJJJJJ  rN)__name__ __module__ __qualname__r r r r rrr'r*rrCheckDetachedScansr/r3r)rrrr/s! H       VK *++..,+.rrN)__doc__loggingr!defence360agent.contracts.pluginsrrr"defence360agent.contracts.messagesrdefence360agent.utilsr defence360agent.utils.check_lockr *imav.malwarelib.scan.cleaners.detached_dirr ,imav.malwarelib.scan.cleaners.outdated_scansr r r /imav.malwarelib.scan.cleaners.uncompleted_scansrr4r,rr)rrrAsB* ;:::::111111777777  8  *****}k*****r