BGP-Ranking/bin/dbinsert.py

25 lines
642 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.dbinsert import DatabaseInsert
logging.basicConfig(format='%(asctime)s %(name)s %(levelname)s:%(message)s',
level=logging.INFO, datefmt='%I:%M:%S')
2018-03-30 14:33:33 +02:00
class DBInsertManager(AbstractManager):
def __init__(self, loglevel: int=logging.INFO):
2018-03-30 14:33:33 +02:00
super().__init__(loglevel)
self.dbinsert = DatabaseInsert(loglevel)
2018-03-30 14:33:33 +02:00
def _to_run_forever(self):
2018-03-29 22:37:28 +02:00
self.dbinsert.insert()
if __name__ == '__main__':
2018-03-30 14:33:33 +02:00
dbinsert = DBInsertManager()
dbinsert.run(sleep_in_sec=120)