Compare commits

..

8 Commits

Author SHA1 Message Date
d5895b8888 Merge pull request 'fix' (#37) from master into dev
Reviewed-on: #37
2025-09-15 00:33:37 +03:00
Egor Matveev
8799b3107b fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 22s
Deploy Dev / Push (pull_request) Successful in 13s
Deploy Dev / Deploy dev (pull_request) Successful in 17s
Deploy Prod / Build (pull_request) Successful in 6s
Deploy Prod / Push (pull_request) Successful in 9s
Deploy Prod / Deploy prod (pull_request) Successful in 17s
2025-09-15 00:33:18 +03:00
83718675d7 Merge pull request 'fix' (#36) from master into dev
Reviewed-on: #36
2025-09-15 00:28:31 +03:00
Egor Matveev
7a2950e480 fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 6s
Deploy Dev / Push (pull_request) Successful in 9s
Deploy Dev / Deploy dev (pull_request) Successful in 17s
2025-09-15 00:28:09 +03:00
50a26e0e1d Merge pull request 'fix' (#35) from master into dev
Reviewed-on: #35
2025-09-15 00:19:46 +03:00
Egor Matveev
7448b4e0c6 fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 20s
Deploy Dev / Push (pull_request) Successful in 9s
Deploy Dev / Deploy dev (pull_request) Successful in 17s
2025-09-15 00:19:20 +03:00
d670c9375c Merge pull request 'Update helpers/answer.py' (#33) from master into dev
Reviewed-on: #33
2025-09-14 10:13:51 +03:00
5e2c725bc2 Update helpers/answer.py
All checks were successful
Deploy Dev / Build (pull_request) Successful in 5s
Deploy Dev / Push (pull_request) Successful in 9s
Deploy Dev / Deploy dev (pull_request) Successful in 15s
Deploy Prod / Build (pull_request) Successful in 6s
Deploy Prod / Push (pull_request) Successful in 10s
Deploy Prod / Deploy prod (pull_request) Successful in 15s
2025-09-14 10:13:29 +03:00
6 changed files with 16 additions and 19 deletions

View File

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

View File

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

View File

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

View File

@@ -55,13 +55,6 @@ class Answer:
def process(self):
user = User(self.user['chat_id'])
try:
bot_enabled_exp = platform.get_experiment('bot_enabled')
if not bot_enabled_exp['enabled'] or not eval(bot_enabled_exp['condition']):
return
except Exception as exc:
logging.info(exc)
return
getattr(
self,
"handle_state_" + self.user['state'],

View File

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

View File

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