-
Notifications
You must be signed in to change notification settings - Fork 61
have flush return the count of successful invalidation requests #47
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,11 +106,13 @@ public function flush() | |
{ | ||
$queue = $this->queue; | ||
if (0 === count($queue)) { | ||
return; | ||
return 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note that this is no real BC break as we did not respect the fluent interface we promised in the interface... |
||
} | ||
|
||
$this->queue = array(); | ||
$this->sendRequests($queue); | ||
|
||
return count($queue); | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,13 @@ sub vcl_recv { | |
sub vcl_hit { | ||
if (req.request == "PURGE") { | ||
purge; | ||
error 200 "Purged"; | ||
error 204 "Purged"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we send no body so its 204 not 200. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
} | ||
|
||
sub vcl_miss { | ||
if (req.request == "PURGE") { | ||
purge; | ||
error 404 "Not in cache"; | ||
error 204 "Purged (Not in cache)"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like this its still debuggable what is going on. |
||
} | ||
} | ||
} |
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.
noticed that what we really want is to get the number from the CacheInvalidator too, not just the proxy.