BGP-Ranking/bin/shutdown.py

17 lines
434 B
Python
Raw Normal View History

2018-07-13 14:51:00 +02:00
#!/usr/bin/env python3
2018-03-29 22:37:28 +02:00
# -*- coding: utf-8 -*-
from bgpranking.libs.helpers import is_running, get_socket_path
2018-03-29 22:37:28 +02:00
import time
from redis import StrictRedis
if __name__ == '__main__':
r = StrictRedis(unix_socket_path=get_socket_path('cache'), db=1, decode_responses=True)
2018-03-29 22:37:28 +02:00
r.set('shutdown', 1)
while True:
running = is_running()
print(running)
if not running:
break
time.sleep(10)