mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-09-27 03:28:14 -05:00
feat(scrape): label OOM skips and hint container memory
Classify aborted/OOM export skips as SKIPPED (OOM/aborted) in the run summary with salvage/memory guidance; verify-operator-ready shows configured DCE_CONTAINER_MEMORY.
This commit is contained in:
@@ -416,7 +416,8 @@ run_wrapper skip-abort append 2>"$SKIP_ABORT_LOG"
|
||||
SKIP_ABORT_DEST="$ARCHIVE_ROOT/skip-abort/$DEFAULT_FILE_NAME"
|
||||
[[ "$(jq -r '.messages | length' "$SKIP_ABORT_DEST")" == "3" ]] || { echo "expected skip-abort to append accessible channel" >&2; exit 1; }
|
||||
[[ ! -e "$ARCHIVE_ROOT/skip-abort/channels/134.json" ]] || { echo "unexpected fallback file for skipped abort channel" >&2; exit 1; }
|
||||
grep -q 'SKIPPED.*134' "$SKIP_ABORT_LOG" || { echo "expected SKIPPED line for abort channel 134" >&2; exit 1; }
|
||||
grep -q 'SKIPPED (OOM/aborted).*134' "$SKIP_ABORT_LOG" || { echo "expected SKIPPED_OOM line for abort channel 134" >&2; exit 1; }
|
||||
grep -q 'Hint: for OOM/aborted channels' "$SKIP_ABORT_LOG" || { echo "expected OOM operator hint in scrape summary" >&2; exit 1; }
|
||||
grep -q 'Preserving partial export temp' "$SKIP_ABORT_LOG" || { echo "expected partial temp preserved on abort channel 134" >&2; exit 1; }
|
||||
partial_temp_dirs=( "$ARCHIVE_ROOT/skip-abort/.dce-temp"/export.134.* )
|
||||
[[ -d "${partial_temp_dirs[0]}" ]] || { echo "expected partial temp dir preserved for channel 134" >&2; exit 1; }
|
||||
|
||||
@@ -37,6 +37,27 @@ JSON
|
||||
|
||||
printf 'DISCORD_TOKEN=dummy\n' >"$ENV_PATH"
|
||||
|
||||
mem_output=$(
|
||||
DCE_MIN_FREE_MB=0 DCE_REPO_ROOT="$REPO_ROOT" DCE_CONFIG_FILE="$CONFIG_PATH" DCE_ENV_FILE="$ENV_PATH" \
|
||||
"$VERIFY" --config "$CONFIG_PATH" 2>&1
|
||||
)
|
||||
grep -q 'Operator ready' <<<"$mem_output" || {
|
||||
printf 'ERROR: verify-operator-ready failed\n' >&2
|
||||
printf '%s\n' "$mem_output" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
printf 'DISCORD_TOKEN=dummy\nDCE_CONTAINER_MEMORY=8g\n' >"$ENV_PATH"
|
||||
mem_output=$(
|
||||
DCE_MIN_FREE_MB=0 DCE_REPO_ROOT="$REPO_ROOT" DCE_CONFIG_FILE="$CONFIG_PATH" DCE_ENV_FILE="$ENV_PATH" \
|
||||
"$VERIFY" --config "$CONFIG_PATH" 2>&1
|
||||
)
|
||||
grep -q 'container memory: 8g' <<<"$mem_output" || {
|
||||
printf 'ERROR: expected container memory line in verify output\n' >&2
|
||||
printf '%s\n' "$mem_output" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
cat >"$FAKE_DOCKER" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
if [[ "${1:-}" == "compose" && "${2:-}" == "version" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user