Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26ec51c

Browse files
committed
Look for '200 Purged' in cache.purge output
If the command succeeds we should see output like:```[cache-3.router] out: HTTP/1.1 200 Purged[cache-3.router] out:[cache-3.router] out: Server: Varnish[cache-3.router] out:[cache-3.router] out: Content-Type: text/html; charset=utf-8[cache-3.router] out:[cache-3.router] out: Retry-After: 5[cache-3.router] out:[cache-3.router] out: Content-Length: 380[cache-3.router] out:[cache-3.router] out: Accept-Ranges: bytes[cache-3.router] out:[cache-3.router] out: Date: Fri, 08 May 2015 13:51:59 GMT[cache-3.router] out:[cache-3.router] out: X-Varnish: 1941001298[cache-3.router] out:[cache-3.router] out: Age: 0[cache-3.router] out:[cache-3.router] out: Via: 1.1 varnish[cache-3.router] out:[cache-3.router] out: Connection: close[cache-3.router] out:[cache-3.router] out: X-Cache: MISS[cache-3.router] out:[cache-3.router] out:[cache-3.router] out:[cache-3.router] out:```This is very verbose when running the command across multiple cachenodes.This commit `grep`s for `200 Purged`, which has the following benefits:- It makes the output smaller- It will exit non-0 if it can't find any matching lines, which means the command will fail and notify us if the response doesn't match expectations
1 parentb0827f3 commit26ec51c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cache.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
defpurge(*args):
66
"Purge items from varnish, eg\"/one,/two,/three\""
77
forpathinargs:
8-
run("curl -s -I -X PURGE http://localhost:7999%s"%path.strip())
8+
run("curl -s -I -X PURGE http://localhost:7999%s | grep '200 Purged'"%path.strip())
99

1010
@task
1111
@roles('class-cache')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp