Compare commits

..

10 Commits

Author SHA1 Message Date
4e50ec568d Merge pull request 'master' (#34) from master into prod
Reviewed-on: #34
2025-09-14 10:35:20 +03:00
ea8164096e Merge pull request 'fix' (#30) from master into prod
Reviewed-on: #30
2025-06-15 23:31:10 +03:00
5392a9acc3 Merge pull request 'master' (#29) from master into prod
Reviewed-on: #29
2025-06-15 23:29:02 +03:00
32cdf983e8 Merge pull request 'fix' (#24) from master into prod
Reviewed-on: #24
2024-11-27 19:11:56 +03:00
b9aafe8c4f Merge pull request 'master' (#23) from master into prod
Reviewed-on: #23
2024-11-27 19:08:36 +03:00
b150f2fafc Merge pull request 'fix' (#18) from queues into prod
Reviewed-on: #18
2024-11-27 02:45:44 +03:00
f8ec8af981 Merge pull request 'fix' (#16) from queues into prod
Reviewed-on: #16
2024-11-26 20:00:36 +03:00
26af411bf4 Merge pull request 'queues' (#15) from queues into prod
Reviewed-on: #15
2024-11-25 00:07:14 +03:00
034f19aea9 Merge pull request 'deploy' (#4) from master into prod
Reviewed-on: #4
2024-10-11 07:17:13 +03:00
8a10b1d180 Merge pull request 'deploy' (#3) from master into prod
Reviewed-on: #3
2024-10-11 07:14:07 +03:00
5 changed files with 12 additions and 16 deletions

View File

@@ -6,12 +6,12 @@ services:
worker: worker:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.dev.chocomarsh.com"
STAGE: "development" STAGE: "development"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
networks: networks:
- queues-development - queues-development
- configurator - configurator
- mongo-development
command: worker command: worker
deploy: deploy:
mode: replicated mode: replicated
@@ -24,11 +24,12 @@ services:
fetch: fetch:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.dev.chocomarsh.com"
STAGE: "development" STAGE: "development"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
networks: networks:
- queues-development - queues-development
- mongo-development
command: fetch command: fetch
deploy: deploy:
mode: replicated mode: replicated
@@ -41,11 +42,12 @@ services:
notify: notify:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.dev.chocomarsh.com"
STAGE: "development" STAGE: "development"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
networks: networks:
- queues-development - queues-development
- mongo-development
command: notify command: notify
deploy: deploy:
mode: replicated mode: replicated
@@ -60,10 +62,11 @@ services:
networks: networks:
- common-infra-nginx-development - common-infra-nginx-development
- queues-development - queues-development
- mongo-development
environment: environment:
MONGO_HOST: "mongo.dev.chocomarsh.com"
STAGE: "development" STAGE: "development"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
command: api command: api
deploy: deploy:
mode: replicated mode: replicated
@@ -80,5 +83,3 @@ networks:
external: true external: true
configurator: configurator:
external: true external: true
mongo-development:
external: true

View File

@@ -6,12 +6,12 @@ services:
worker: worker:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.chocomarsh.com"
STAGE: "production" STAGE: "production"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
networks: networks:
- queues - queues
- configurator - configurator
- mongo
command: worker command: worker
deploy: deploy:
mode: replicated mode: replicated
@@ -24,13 +24,13 @@ services:
fetch: fetch:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.chocomarsh.com"
STAGE: "production" STAGE: "production"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
DEBUG: "false" DEBUG: "false"
networks: networks:
- queues - queues
- configurator - configurator
- mongo
command: fetch command: fetch
deploy: deploy:
mode: replicated mode: replicated
@@ -43,13 +43,13 @@ services:
notify: notify:
image: mathwave/sprint-repo:ruz-bot image: mathwave/sprint-repo:ruz-bot
environment: environment:
MONGO_HOST: "mongo.chocomarsh.com"
STAGE: "production" STAGE: "production"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
DEBUG: "false" DEBUG: "false"
networks: networks:
- queues - queues
- configurator - configurator
- mongo
command: notify command: notify
deploy: deploy:
mode: replicated mode: replicated
@@ -64,8 +64,8 @@ services:
networks: networks:
- common-infra-nginx - common-infra-nginx
- configurator - configurator
- mongo
environment: environment:
MONGO_HOST: "mongo.chocomarsh.com"
STAGE: "production" STAGE: "production"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
DEBUG: "false" DEBUG: "false"
@@ -85,5 +85,3 @@ networks:
external: true external: true
configurator: configurator:
external: true external: true
mongo:
external: true

View File

@@ -7,7 +7,6 @@ RUN apt-get install -y locales locales-all
ENV LANGUAGE ru_RU.UTF-8 ENV LANGUAGE ru_RU.UTF-8
ENV LANG ru_RU.UTF-8 ENV LANG ru_RU.UTF-8
ENV LC_ALL ru_RU.UTF-8 ENV LC_ALL ru_RU.UTF-8
ENV PYTHONUNBUFFERED=1
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY . . COPY . .

View File

@@ -9,7 +9,7 @@ from helpers import now
class Mongo: class Mongo:
def __init__(self): def __init__(self):
url = f"mongodb://{settings.MONGO_USER}:{settings.MONGO_PASSWORD}@mongo:27017/" url = f"mongodb://{settings.MONGO_USER}:{settings.MONGO_PASSWORD}@{settings.MONGO_HOST}:27017/"
self.client = pymongo.MongoClient(url) self.client = pymongo.MongoClient(url)
self.database = self.client.get_database("ruz-bot") self.database = self.client.get_database("ruz-bot")
self.users_collection.create_index([ self.users_collection.create_index([

View File

@@ -1,7 +1,6 @@
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
import datetime import datetime
import os import os
import traceback
import zoneinfo import zoneinfo
import requests import requests
import time import time
@@ -56,7 +55,6 @@ class TasksHandlerMixin:
success = True success = True
except Exception as exc: except Exception as exc:
print(f'Error processing message id={task["id"]}, payload={task["payload"]}, exc={exc}') print(f'Error processing message id={task["id"]}, payload={task["payload"]}, exc={exc}')
traceback.print_exc()
success = False success = False
end = datetime.datetime.now(zoneinfo.ZoneInfo("Europe/Moscow")) end = datetime.datetime.now(zoneinfo.ZoneInfo("Europe/Moscow"))
if success: if success: