fix
This commit is contained in:
parent
a707a8b93e
commit
7b9d264ef9
@ -38,5 +38,3 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
queues-development:
|
queues-development:
|
||||||
external: true
|
external: true
|
||||||
monitoring:
|
|
||||||
external: true
|
|
||||||
|
@ -13,7 +13,7 @@ class Daemon(base.Daemon):
|
|||||||
for file in os.listdir('/usr/src/metrics'):
|
for file in os.listdir('/usr/src/metrics'):
|
||||||
data = open(f'/usr/src/metrics/{file}', 'r').read()
|
data = open(f'/usr/src/metrics/{file}', 'r').read()
|
||||||
payload = json.loads(data)
|
payload = json.loads(data)
|
||||||
resp = post('http://monitoring:1237/api/v1/metrics/task', json=payload)
|
resp = post('http://queues:1239/api/v1/metric', json=payload)
|
||||||
if resp.status_code == 202:
|
if resp.status_code == 202:
|
||||||
print("Metric ok")
|
print("Metric ok")
|
||||||
else:
|
else:
|
||||||
|
2
run.sh
2
run.sh
@ -4,7 +4,7 @@
|
|||||||
python3 main.py $1 &
|
python3 main.py $1 &
|
||||||
|
|
||||||
# Start the second process
|
# Start the second process
|
||||||
# python3 main.py metrics &
|
python3 main.py metrics &
|
||||||
|
|
||||||
# Wait for any process to exit
|
# Wait for any process to exit
|
||||||
wait -n
|
wait -n
|
||||||
|
@ -60,7 +60,7 @@ class TasksHandlerMixin:
|
|||||||
print(f'finish task with id {task["id"]}')
|
print(f'finish task with id {task["id"]}')
|
||||||
except:
|
except:
|
||||||
print(f'Failed to finish task id={task["id"]}')
|
print(f'Failed to finish task id={task["id"]}')
|
||||||
# self._send_metric(start, end, success)
|
self._send_metric(start, end, success)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def queue_name(self):
|
def queue_name(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user