BGP-Ranking/bin/sanitizer.py

26 lines
648 B
Python
Raw Normal View History

2018-07-13 14:51:00 +02:00
#!/usr/bin/env python3
# -*- 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
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
level=logging.WARNING, datefmt='%I:%M:%S')
2018-03-30 14:33:33 +02:00
class SanitizerManager(AbstractManager):
def __init__(self, loglevel: int=logging.WARNING):
2018-03-30 14:33:33 +02:00
super().__init__(loglevel)
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()
if __name__ == '__main__':
2018-03-30 14:33:33 +02:00
sanitizer = SanitizerManager()
sanitizer.run(sleep_in_sec=120)