Compare commits

...

2 Commits

Author SHA1 Message Date
bea73c9322 Merge pull request 'fix' (#78) from metric into dev
Reviewed-on: https://gitea.chocomarsh.com/self/botalka/pulls/78
2025-06-15 17:08:46 +03:00
Egor Matveev
7b9d264ef9 fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 8s
Deploy Dev / Push (pull_request) Successful in 10s
Deploy Dev / Deploy dev (pull_request) Successful in 12s
2025-06-15 17:08:15 +03:00
4 changed files with 3 additions and 5 deletions

View File

@ -38,5 +38,3 @@ networks:
external: true
queues-development:
external: true
monitoring:
external: true

View File

@ -13,7 +13,7 @@ class Daemon(base.Daemon):
for file in os.listdir('/usr/src/metrics'):
data = open(f'/usr/src/metrics/{file}', 'r').read()
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:
print("Metric ok")
else:

2
run.sh
View File

@ -4,7 +4,7 @@
python3 main.py $1 &
# Start the second process
# python3 main.py metrics &
python3 main.py metrics &
# Wait for any process to exit
wait -n

View File

@ -60,7 +60,7 @@ class TasksHandlerMixin:
print(f'finish task with id {task["id"]}')
except:
print(f'Failed to finish task id={task["id"]}')
# self._send_metric(start, end, success)
self._send_metric(start, end, success)
@property
def queue_name(self):