2018-07-13 14:51:00 +02:00
|
|
|
#!/usr/bin/env python3
|
2018-03-12 15:29:18 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import logging
|
2018-03-30 14:33:33 +02:00
|
|
|
|
|
|
|
from bgpranking.abstractmanager import AbstractManager
|
2018-03-29 22:37:28 +02:00
|
|
|
from bgpranking.sanitizer import Sanitizer
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
|
2018-03-21 17:58:36 +01:00
|
|
|
level=logging.WARNING, datefmt='%I:%M:%S')
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
|
2018-03-30 14:33:33 +02:00
|
|
|
class SanitizerManager(AbstractManager):
|
2018-03-12 15:29:18 +01:00
|
|
|
|
2018-03-21 17:58:36 +01:00
|
|
|
def __init__(self, loglevel: int=logging.WARNING):
|
2018-03-30 14:33:33 +02:00
|
|
|
super().__init__(loglevel)
|
2018-03-12 15:29:18 +01:00
|
|
|
self.sanitizer = Sanitizer(loglevel)
|
|
|
|
|
2018-03-30 14:33:33 +02:00
|
|
|
def _to_run_forever(self):
|
2018-03-29 22:37:28 +02:00
|
|
|
self.sanitizer.sanitize()
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-03-30 14:33:33 +02:00
|
|
|
sanitizer = SanitizerManager()
|
|
|
|
sanitizer.run(sleep_in_sec=120)
|