From cee678591f0bff493da29a33a0078fd6cf894de4 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 29 Apr 2024 15:44:25 +0200 Subject: [PATCH] Merge pull request #18145 from overleaf/msm-ce-history-scripts [CE] Add history utility scripts (flush/resync) GitOrigin-RevId: 3f46609c279bef70f1ee6e63f74648f1c2b99a97 --- server-ce/Dockerfile | 7 +++++++ server-ce/bin/flush-history-queues | 8 ++++++++ server-ce/bin/force-history-resyncs | 8 ++++++++ 3 files changed, 23 insertions(+) create mode 100755 server-ce/bin/flush-history-queues create mode 100755 server-ce/bin/force-history-resyncs diff --git a/server-ce/Dockerfile b/server-ce/Dockerfile index fd3fdc582c..aafc3c0903 100644 --- a/server-ce/Dockerfile +++ b/server-ce/Dockerfile @@ -80,6 +80,13 @@ COPY server-ce/config/custom-environment-variables.json /overleaf/services/histo ADD server-ce/bin/grunt /usr/local/bin/grunt RUN chmod +x /usr/local/bin/grunt +# Copy history helper scripts +# --------------------------- +ADD server-ce/bin/flush-history-queues /overleaf/bin/flush-history-queues +RUN chmod +x /overleaf/bin/flush-history-queues +ADD server-ce/bin/force-history-resyncs /overleaf/bin/force-history-resyncs +RUN chmod +x /overleaf/bin/force-history-resyncs + # File that controls open|closed status of the site # ------------------------------------------------- ENV SITE_MAINTENANCE_FILE "/etc/overleaf/site_status" diff --git a/server-ce/bin/flush-history-queues b/server-ce/bin/flush-history-queues new file mode 100755 index 0000000000..b54bc5558c --- /dev/null +++ b/server-ce/bin/flush-history-queues @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +source /etc/container_environment.sh +source /etc/overleaf/env.sh +cd /overleaf/services/project-history +node scripts/flush_all.js 100000 diff --git a/server-ce/bin/force-history-resyncs b/server-ce/bin/force-history-resyncs new file mode 100755 index 0000000000..389c98a4ad --- /dev/null +++ b/server-ce/bin/force-history-resyncs @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +source /etc/container_environment.sh +source /etc/overleaf/env.sh +cd /overleaf/services/project-history +node scripts/force_resync.js 1000 force