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

Improved/fixed failed request queue #12

Merged
merged 9 commits into from
Apr 17, 2017
Merged

Improved/fixed failed request queue #12

merged 9 commits into from
Apr 17, 2017

Conversation

ErikBjare
Copy link
Member

Completely forgot to file a PR for this, I've been running it for quite a while now.

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Mar 18, 2017

Merge needed to resolve conflicts

@johan-bjareholt
Copy link
Member

How long have you tested this branch?

@ErikBjare
Copy link
Member Author

I don't know, at least for 21 days I assume since that's when the first commits are from.

@ErikBjare
Copy link
Member Author

But not after the merge with master...

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Mar 20, 2017

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.

@ErikBjare
Copy link
Member Author

@johan-bjareholt Can we merge this now? master is unstable atm...

@ErikBjare ErikBjare changed the title Dev/fix queue Improved/fixed failed request queue Apr 17, 2017
# 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")
Copy link
Member Author

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
Copy link
Member Author

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):
Copy link
Member

@johan-bjareholt johan-bjareholt Apr 17, 2017

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

return aw_core.config.load_config("aw-client", default_client_config)

# DEPRECATED, use load_config() instead.
config = load_config()
Copy link
Member

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

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()
Copy link
Member

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

@ErikBjare ErikBjare merged commit d1c7632 into master Apr 17, 2017
@ErikBjare ErikBjare deleted the dev/fix-queue branch April 17, 2017 11:22
vasuemme111 pushed a commit to dholendar-27/aw-client that referenced this pull request Apr 24, 2024
"Resolved duplicate app name in application model"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants