|
@@ -26,6 +26,7 @@ parser.add_argument('--dashing-url', help='Dashing URL')
|
|
|
parser.add_argument('--dashing-token', help='Dashing\'s secret update token')
|
|
|
parser.add_argument('--api-bind-host', default='::', help='API-Server Hostname')
|
|
|
parser.add_argument('--api-bind-port', type=int, default=8888, help='API-Server Port')
|
|
|
+parser.add_argument('-S', '--storage-dir', default='.', help='Path where to store data')
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
if args.interval < 5:
|
|
@@ -49,7 +50,8 @@ if args.no_detach:
|
|
|
|
|
|
logger.info('Starting up')
|
|
|
|
|
|
-storage = Storage()
|
|
|
+storage = Storage(args.storage_dir)
|
|
|
+logger.info('Storage: ' + str(storage))
|
|
|
|
|
|
a = AlfredParser()
|
|
|
b = BatmanParser()
|
|
@@ -107,11 +109,15 @@ while True:
|
|
|
logger.debug('Step 3/3: Merging current data ...')
|
|
|
storage.data = dict_merge(storage.data, newdata)
|
|
|
logger.info('I have data for ' + str(len(storage.data)) + ' nodes.')
|
|
|
+
|
|
|
+ storage.save()
|
|
|
+
|
|
|
except Exception as err:
|
|
|
logger.error(str(err))
|
|
|
|
|
|
logger.debug('Sleeping for {0} seconds'.format(args.interval))
|
|
|
time.sleep(args.interval)
|
|
|
|
|
|
+storage.close()
|
|
|
logger.info('Shut down.')
|
|
|
|