Skip to content
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

Add Hosting Method for SCREEN and SYSTEMD #2988

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def hosting_method(self) -> HostingMethod:
if os.environ.get("pm_id"):
return HostingMethod.PM2

if os.environ.get("INVOCATION_ID"):
return HostingMethod.SYSTEMD

if os.environ.get("TERM"):
return HostingMethod.SCREEN

return HostingMethod.OTHER

def startup(self):
Expand Down
2 changes: 2 additions & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,5 @@ class HostingMethod(IntEnum):
HEROKU = 0
PM2 = 1
OTHER = 2
SYSTEMD = 3
SCREEN = 4