-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run the bot in a separate process #78
Comments
I see that there is some prior discussion on this and a comment in @missytake What was the reason to run everything in a single process? Starting threads from the |
in redoing mailadm setup, i agree. |
Flask documentation says you always need some production WSGI server: https://flask.palletsprojects.com/en/2.2.x/deploying/ |
thanks to link2xt nice update of the docs, the cli usage is a lot easier now. |
I think the main reason was that it was unclear yet how much the different parts of the system need to talk to each other. But if every part of mailadm can do mailcow API requests on its own, then #56 is the last use case I can think of where mailadm-prune and mailadm-bot need to talk to each other. |
I think in the most urgent sense it would not be necessary to make mailadm very modular - at least when #56 is merged, it will not make much sense anymore to run mailadm without either gunicorn, mailadm-bot, mailadm-prune, or mailcow. But I agree with two advantages in making it modular:
Am I correct in the assumption that you would still want all of the processes to make mailcow requests? So there is not one process responsible for doing mailcow requests? I see one problem for #56 - the mailadm-prune thread is currently responsible for sending out the warnings. If mailadm-bot is running in a separate container, it can't pass the warnings to it for sending them out. But it can't run a separate deltachat core either, as mailadm-bot needs to receive all the incoming messages reliably. |
I support modularization with the goal to make it easier to:
|
Currently the bot is started as a thread within gunicorn process. It means that when the bot crashes, calls
os._exit
or needs to be restarted,gunicorn
process has some downtime too.We can still build a single Docker image, but start it twice with the same volume: once as
gunicorn ...
, and once as apython -m mailadm bot ...
or something like this. Thengunicorn
will run in a separate container with its own logs and no task except for processingnew_email
requests.Pruning loop could also be a separate process, like
python -m mailadm prune-loop
or something like this, also running in a separate container.This would make it easier to monitor and debug
gunicorn
, which provides the most important service.The text was updated successfully, but these errors were encountered: