from application.model import BaseThread
from application.service import JanitorService
from application.util import LoggerUtil

logger = LoggerUtil.get_logger_name(__name__)


class JanitorManager(BaseThread):
    def __init__(
        self,                       # type: JanitorManager
        janitor_service,            # type: JanitorService
    ):
        # type: (...) -> None

        super(JanitorManager, self).__init__()

        self.janitor_service = janitor_service

    def run(
        self,       # type: JanitorManager
    ):
        # type: (...) -> None

        self._clean_the_mess()

    def _clean_the_mess(
        self,       # type: JanitorManager
    ):
        # type: (...) -> None

        self.janitor_service.clean_internal_order_file()
