Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

[API] make DELETE "/clients/#{id}" idempotent #431

Closed
wants to merge 1 commit into from
Closed

[API] make DELETE "/clients/#{id}" idempotent #431

wants to merge 1 commit into from

Conversation

willscripted
Copy link

Not a solution, but related to #430. With mysteriously missing redis keys, DELETE /clients/b33f will not actually remove a client from the clients set, clear the history, or delete events. It seems a DELETE request ought to be idempotent and result in a clean state with or without the existence of a client key

@willscripted willscripted mentioned this pull request Jan 8, 2013
$redis.hgetall('events:' + client_name).callback do |events|
events.each do |check_name, event_json|
resolve_event(event_hash(event_json, client_name, check_name))
end
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason retrieving the events isn't rolled into the EM timer? Does resolve_event have the opportunity to throw or change the API response?

@portertech
Copy link
Contributor

This is very strange, as a client key cannot exist in the clients set, unless it has be created (only done by the server, always stringified JSON).

@portertech
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants