-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improved/fixed failed request queue #12
Conversation
Merge needed to resolve conflicts |
How long have you tested this branch? |
I don't know, at least for 21 days I assume since that's when the first commits are from. |
But not after the merge with master... |
The merge with master hopefully and probably doesn't break anything. Would be nice though if you could extra check that the data look right in aw-webui even after shutting aw-server on and off a few times just to verify. |
@johan-bjareholt Can we merge this now? master is unstable atm... |
# The `block=False` and `if request is not None` stuff here is actually required, see Python docs. | ||
request = self._queue.get(block=False) | ||
if request is not None: | ||
queue_fp.write(json.dumps(request) + "\n") |
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.
Pretty sure this fixes #10 if not already fixed.
except req.RequestException: | ||
return False | ||
|
||
@RestartOnException |
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.
This should fix #8 acceptably.
QueuedRequest = namedtuple("QueuedRequest", ["endpoint", "data"]) | ||
|
||
|
||
def RestartOnException(f): |
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.
Would be nice to have this in aw-core, but not necessary
aw_client/config.py
Outdated
return aw_core.config.load_config("aw-client", default_client_config) | ||
|
||
# DEPRECATED, use load_config() instead. | ||
config = load_config() |
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 safely remove this now
aw_client/client.py
Outdated
if not os.path.exists(failed_queues_dir): | ||
os.makedirs(failed_queues_dir) | ||
self.queue_file = os.path.join(failed_queues_dir, self.client.client_name) | ||
|
||
self._load_queue() |
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.
This line should be completely removed to fix clearing the file queue when not intended. My mistake
"Resolved duplicate app name in application model"
Completely forgot to file a PR for this, I've been running it for quite a while now.