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

www: log cdn purge calls #2269

Merged
merged 2 commits into from
Apr 10, 2020
Merged

www: log cdn purge calls #2269

merged 2 commits into from
Apr 10, 2020

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Apr 7, 2020

Ref: #2264

We don't have logs of our calls to Cloudflare's cache purge API calls we make when we promote new /download/ assets or publish new website content, so this is adding such logging. Along the way, I think I've found one possible "bug" that may provide a partial explanation to our outage problems, but I'll explain that in #2249

Additional comments inline.

@@ -44,6 +44,7 @@ docker run \
-v /home/nodejs/.npm:/npm/ \
node:latest \
bash -c " \
apt-get update && apt-get install -y rsync && \
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 is a holdover from some website publish debugging we were doing a few months ago, changed on server but not in ansible, I'm unsure if this is necessary but it's there for now!

@@ -27,6 +27,8 @@ if ! [ -f /tmp/cdnpurge.$site ]; then
exit 0
fi

reason="$(cat /tmp/cdnpurge.$site | tr '\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.

Previously this file was a zero-length signal file, now it should contain a "reason", but it may also contain multiple reasons if more than one request was made before we check it, hence the flattening of multiple lines into one. We use this in the log, below.

@rvagg rvagg force-pushed the rvagg/purge-scripts-safer branch from 50ade9c to eb6e0b2 Compare April 7, 2020 08:43
@rvagg rvagg merged commit 3a9a24f into master Apr 10, 2020
@rvagg rvagg deleted the rvagg/purge-scripts-safer branch April 10, 2020 01:25
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.

3 participants