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.dbinsert import DatabaseInsert
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
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):
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
def __init__(self, loglevel: int=logging.DEBUG):
|
2018-03-30 14:33:33 +02:00
|
|
|
super().__init__(loglevel)
|
2018-03-12 15:29:18 +01:00
|
|
|
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()
|
2018-03-12 15:29:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-03-30 14:33:33 +02:00
|
|
|
dbinsert = DBInsertManager()
|
|
|
|
dbinsert.run(sleep_in_sec=120)
|