Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

env examples: document RECORDING_CHUNK_SECONDS, commit batching, session TTL/auto-finalize

Murtaza Nasir151625cadc77
diff --git a/config/env.asr.example b/config/env.asr.example
index ef7ccd2a..60279b70 100644
--- a/config/env.asr.example
+++ b/config/env.asr.example
@@ -315,6 +315,25 @@ MAX_CONCURRENT_UPLOADS=3
# Per-user soft storage cap (in bytes) for in-progress server recording
# sessions. Default: 5368709120 (5 GB).
# RECORDING_SESSION_MAX_BYTES_PER_USER=5368709120
+#
+# MediaRecorder timeslice (seconds): how often each in-app recording emits
+# and uploads a chunk. Smaller = finer crash recovery; larger = fewer
+# requests/files/DB writes. Default: 5 (range 1-60).
+# RECORDING_CHUNK_SECONDS=5
+#
+# How many chunks to accumulate before committing session bookkeeping to the
+# DB. Chunk files always hit disk immediately; only the row counters lag, and
+# finalize re-derives the true count from disk. Raising this cuts DB write
+# pressure at scale (important on SQLite, which is single-writer). Default: 1
+# (commit every chunk). For many concurrent recorders, consider 6 (~30s at 5s
+# chunks) and/or move to PostgreSQL.
+# RECORDING_SESSION_COMMIT_BATCH_SIZE=1
+#
+# Inactivity TTL (hours) before an abandoned in-progress session is reaped.
+# Abandoned sessions that have audio are auto-finalized into the user's
+# library (not discarded), so a crashed or closed-tab recording is not lost.
+# Default: 24.
+# RECORDING_SESSION_TTL_HOURS=24
# --- Webhooks (optional) ---
# Outbound webhooks notify external services when events occur. Configured
diff --git a/config/env.transcription.example b/config/env.transcription.example
index b6ec4f03..151887c7 100644
--- a/config/env.transcription.example
+++ b/config/env.transcription.example
@@ -356,6 +356,25 @@ MAX_CONCURRENT_UPLOADS=3
# Per-user soft storage cap (in bytes) for in-progress server recording
# sessions. Default: 5368709120 (5 GB).
# RECORDING_SESSION_MAX_BYTES_PER_USER=5368709120
+#
+# MediaRecorder timeslice (seconds): how often each in-app recording emits
+# and uploads a chunk. Smaller = finer crash recovery; larger = fewer
+# requests/files/DB writes. Default: 5 (range 1-60).
+# RECORDING_CHUNK_SECONDS=5
+#
+# How many chunks to accumulate before committing session bookkeeping to the
+# DB. Chunk files always hit disk immediately; only the row counters lag, and
+# finalize re-derives the true count from disk. Raising this cuts DB write
+# pressure at scale (important on SQLite, which is single-writer). Default: 1
+# (commit every chunk). For many concurrent recorders, consider 6 (~30s at 5s
+# chunks) and/or move to PostgreSQL.
+# RECORDING_SESSION_COMMIT_BATCH_SIZE=1
+#
+# Inactivity TTL (hours) before an abandoned in-progress session is reaped.
+# Abandoned sessions that have audio are auto-finalized into the user's
+# library (not discarded), so a crashed or closed-tab recording is not lost.
+# Default: 24.
+# RECORDING_SESSION_TTL_HOURS=24
# =============================================================================
# WEBHOOKS (optional)
diff --git a/config/env.whisper.example b/config/env.whisper.example
index e719c452..363b562f 100644
--- a/config/env.whisper.example
+++ b/config/env.whisper.example
@@ -311,6 +311,25 @@ MAX_CONCURRENT_UPLOADS=3
# Per-user soft storage cap (in bytes) for in-progress server recording
# sessions. Default: 5368709120 (5 GB).
# RECORDING_SESSION_MAX_BYTES_PER_USER=5368709120
+#
+# MediaRecorder timeslice (seconds): how often each in-app recording emits
+# and uploads a chunk. Smaller = finer crash recovery; larger = fewer
+# requests/files/DB writes. Default: 5 (range 1-60).
+# RECORDING_CHUNK_SECONDS=5
+#
+# How many chunks to accumulate before committing session bookkeeping to the
+# DB. Chunk files always hit disk immediately; only the row counters lag, and
+# finalize re-derives the true count from disk. Raising this cuts DB write
+# pressure at scale (important on SQLite, which is single-writer). Default: 1
+# (commit every chunk). For many concurrent recorders, consider 6 (~30s at 5s
+# chunks) and/or move to PostgreSQL.
+# RECORDING_SESSION_COMMIT_BATCH_SIZE=1
+#
+# Inactivity TTL (hours) before an abandoned in-progress session is reaped.
+# Abandoned sessions that have audio are auto-finalized into the user's
+# library (not discarded), so a crashed or closed-tab recording is not lost.
+# Default: 24.
+# RECORDING_SESSION_TTL_HOURS=24
# --- Webhooks (optional) ---
# Outbound webhooks notify external services when events occur. Configured