-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclear-render-cache
More file actions
executable file
·22 lines (15 loc) · 1.1 KB
/
clear-render-cache
File metadata and controls
executable file
·22 lines (15 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e
ENV=${1:?"Usage: $0 ENVIRONMENT"}
echo "WARNING: after wiping the cache, there is no way to check for rendered changes. That means the next time each workflow is executed, it will not email change notifications."
read -r -p "Are you okay with skipping some notifications? [y/N] " response
if [ "$response" != "y" ]; then
echo "You did not respond \"y\". Bye."
exit 0
fi
echo "Locking all workflows and clearing all steps' cached output..."
FRONTEND_POD="$(kubectl -n "$ENV" get pods -lapp=frontend-app -oname)"
kubectl -n "$ENV" exec -it "$FRONTEND_POD" -c app -- psql -Ucjworkbench -c "BEGIN; SELECT id FROM workflow FOR UPDATE; UPDATE step SET cached_render_result_delta_id=NULL, cached_render_result_errors='[]'::JSONB, cached_render_result_json='null'::BYTEA, cached_render_result_status=NULL, cached_render_result_columns=NULL, cached_render_result_nrows=NULL; COMMIT"
echo "Deleting files created before [FIXME] from s3..."
echo "TODO. This step isn't done. That means we're wasting disk space with files we'll never read."
echo "TODO build a garbage-collection scheme to clear these files."