Skip to content

Commit

Permalink
fix: detect in-progress backup on Geth node start
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Sep 2, 2024
1 parent 8056852 commit 39d5aaa
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ job "{{ job.name }}" {
{{- end }}
{% endraw %}

{% raw %}
{{ with nomadVar "nomad/jobs" }}
BACKUP="{{ .MEV_COMMIT_GETH_CHAIN_BACKUP }}"
{{ end }}
{% endraw %}

if [[ "${BACKUP}" == "true" ]]; then
echo "Detected ongoing data backup, terminating..."
exit 1
fi

BACKUP_FILE="local/backups/$(
ls -1 local/backups/ |
sed -r 's/(.*)_dirty/\1/' |
Expand Down Expand Up @@ -267,6 +278,17 @@ job "{{ job.name }}" {
{{- end }}
{% endraw %}

{% raw %}
{{ with nomadVar "nomad/jobs" }}
BACKUP="{{ .MEV_COMMIT_GETH_CHAIN_BACKUP }}"
{{ end }}
{% endraw %}

if [[ "${BACKUP}" == "true" ]]; then
echo "Detected ongoing data backup, terminating..."
exit 1
fi

mkdir -p "${GETH_DATA_DIR}" > /dev/null 2>&1

{% if job.artifacts | selectattr('keystore', 'defined') | list | length > 0 %}
Expand Down

0 comments on commit 39d5aaa

Please sign in to comment.