fix
This commit is contained in:
parent
274529bb1a
commit
8c09bef1e9
@ -26,10 +26,10 @@ class Daemon(base.Daemon):
|
|||||||
print(f'process for {project_name} {bot_name} is alive')
|
print(f'process for {project_name} {bot_name} is alive')
|
||||||
continue
|
continue
|
||||||
new_process = multiprocessing.Process(target=self.start_polling, args=[bot_info['secrets']['telegram_token'], bot_info['queue']])
|
new_process = multiprocessing.Process(target=self.start_polling, args=[bot_info['secrets']['telegram_token'], bot_info['queue']])
|
||||||
print(f'starting process for {project_name} {bot_name} is alive')
|
print(f'starting process for {project_name} {bot_name}')
|
||||||
new_process.start()
|
new_process.start()
|
||||||
self.telegram_pollers[project_name][bot_name] = new_process
|
self.telegram_pollers[project_name][bot_name] = new_process
|
||||||
print(f'started process for {project_name} {bot_name} is alive')
|
print(f'started process for {project_name} {bot_name}')
|
||||||
else:
|
else:
|
||||||
if process is None or not process.is_alive:
|
if process is None or not process.is_alive:
|
||||||
print(f'process for {project_name} {bot_name} is not alive')
|
print(f'process for {project_name} {bot_name} is not alive')
|
||||||
|
19
local_platform.json
Normal file
19
local_platform.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"configs": {
|
||||||
|
"bots": {
|
||||||
|
"pizda-bot": {
|
||||||
|
"telegram-bot": {
|
||||||
|
"type": "telegram",
|
||||||
|
"poll_enabled": true,
|
||||||
|
"mailbox_enabled": false,
|
||||||
|
"queue": "pizda_bot_worker",
|
||||||
|
"secrets": {
|
||||||
|
"telegram_token": "5652624181:AAFFVjcHJjea7wlW6MRaxjFY_eu2XWPwOns"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"experiments": {},
|
||||||
|
"platform_staff": {}
|
||||||
|
}
|
22
main.py
22
main.py
@ -1,15 +1,17 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
arg = sys.argv[-1]
|
# arg = sys.argv[-1]
|
||||||
|
arg = 'poll'
|
||||||
|
|
||||||
if arg == "poll":
|
if __name__ == '__main__':
|
||||||
print("poll is starting")
|
if arg == "poll":
|
||||||
from daemons.poll import Daemon
|
print("poll is starting")
|
||||||
elif arg == 'mailbox':
|
from daemons.poll import Daemon
|
||||||
print("mailbox is starting")
|
elif arg == 'mailbox':
|
||||||
from daemons.mailbox import Daemon
|
print("mailbox is starting")
|
||||||
else:
|
from daemons.mailbox import Daemon
|
||||||
raise ValueError(f"Unknown param {arg}")
|
else:
|
||||||
|
raise ValueError(f"Unknown param {arg}")
|
||||||
|
|
||||||
Daemon().execute()
|
Daemon().execute()
|
||||||
|
@ -88,6 +88,6 @@ class PlatformClient:
|
|||||||
|
|
||||||
platform_client = PlatformClient(
|
platform_client = PlatformClient(
|
||||||
'Botalka',
|
'Botalka',
|
||||||
os.getenv('STAGE'),
|
os.getenv('STAGE', 'local'),
|
||||||
need_poll=True,
|
need_poll=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user