-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Django q #1398
Django q #1398
Conversation
- Allows us to track if the worker is running - Due to Stat.get_all() not always working
InvenTree/InvenTree/version.py
Outdated
return [int(g) for g in match.groups()] | ||
|
||
|
||
def versionTupleToInt(version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can compare version tuples directly.
(2,4,1) < (2,4,2): True
(3) > (2,4,2): True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, you learn something new every day. I did not know Python could do that!
now = datetime.now() | ||
past = now - timedelta(minutes=10) | ||
|
||
results = Success.objects.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just delete any heart beat other than the last one while I'm in this code.
|
||
clusters = Stat.get_all() | ||
|
||
if len(clusters) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if clusters:
return True
Since it's more pythonic.
Or if stat.get_all(): return True
} | ||
|
||
all_healthy = True | ||
|
||
for k in status.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all_healthy = all([v for v in status.values()])
6d599c8
to
c6e154f
Compare
I tend to say yes for simplicity with dealing with the media/statics, but you could also just make life easier for yourself and just provide a configuration for a docker-compose with nginx sitting in front of it. |
- Note: not ready yet!
- All InvenTree data now in a single subdir - Copy default config file (if it does not exist) - Config file is accessible from outside world - Update start_server and start_worker scripts
@rcludwick I think this is ready for a test drive now. Please let me know if you can get it working on your end, and if there's anything else I should add, before it goes live on dockerhub |
# Conflicts: # InvenTree/InvenTree/version.py
Apologies, I didn't get a chance this weekend to look at it this weekend. I can't wait to try it out on my "production" server at home. If I see anything wrong, I'll just file issues/PR's. 🎉 |
Support for background tasks.
Docs: inventree/inventree-docs#92