BGP-Ranking/bin/ranking.py

26 lines
685 B
Python
Raw Normal View History

2018-07-13 14:51:00 +02:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from bgpranking.abstractmanager import AbstractManager
from bgpranking.ranking import Ranking
from pathlib import Path
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
level=logging.INFO, datefmt='%I:%M:%S')
class RankingManager(AbstractManager):
2018-04-10 01:46:38 +02:00
def __init__(self, config_dir: Path=None, loglevel: int=logging.INFO):
super().__init__(loglevel)
self.ranking = Ranking(config_dir, loglevel)
def _to_run_forever(self):
self.ranking.compute()
if __name__ == '__main__':
dbinsert = RankingManager()
dbinsert.run(sleep_in_sec=3600)