fix: make python commands modular and reusable

This commit is contained in:
Revant Nandgaonkar
2020-03-20 20:56:23 +05:30
parent 8ce9d4214d
commit 7c356ccb27
8 changed files with 112 additions and 95 deletions

View File

@@ -1,7 +1,10 @@
import os, frappe
from frappe.utils.background_jobs import start_worker
queue = os.environ.get("WORKER_TYPE", "default")
start_worker(queue, False)
def main():
queue = os.environ.get("WORKER_TYPE", "default")
start_worker(queue, False)
exit(0)
exit(0)
if __name__ == "__main__":
main()