Commit Graph

20 Commits

Author SHA1 Message Date
rishikanthc
8db87491df Remove multi-track backend code 2026-04-25 14:42:05 -07:00
scnerd
77c3365a4a Add TODO comment to remember that this fix is really about technical debt and we should just remove the legacy workers argument entirely. 2026-04-21 10:38:09 -07:00
scnerd
d0a1dcbd6c docs(queue): add comments to test functions for consistency
All six test functions now have // TestFoo verifies... comments
matching the project's existing convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
scnerd
8b3f25f801 refactor(queue): use testify assertions and t.Setenv in queue tests
Switch from raw t.Errorf to testify/assert for consistency with the
rest of the codebase. Use t.Setenv() instead of manual os.Setenv/defer
os.Unsetenv for automatic cleanup. Simplify table structs where min
and max are always equal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
scnerd
8d05a7cdd9 fix(queue): allow QUEUE_WORKERS env var to override hardcoded worker count
The QUEUE_WORKERS environment variable was defined and read in
getOptimalWorkerCount(), but NewTaskQueue() unconditionally overwrote
the result with the hardcoded legacyWorkers parameter (always 2).
This made QUEUE_WORKERS effectively dead code.

Now legacyWorkers is only used as a fallback when QUEUE_WORKERS is
not set, preserving the default of 2 workers while allowing users
to control concurrency via the environment variable.

Set QUEUE_WORKERS=1 to serialize all transcription jobs and prevent
system overload during bulk uploads.

Fixes: rishikanthc/Scriberr#379

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
scnerd
1ab08ddc11 test(queue): add unit tests for QUEUE_WORKERS env var behavior
Add tests verifying that getOptimalWorkerCount() respects the
QUEUE_WORKERS environment variable and that NewTaskQueue() should
allow QUEUE_WORKERS to override the hardcoded legacy worker count.

Includes a failing test (TestNewTaskQueue_EnvOverridesLegacy) that
reproduces the bug where QUEUE_WORKERS is always overridden by the
hardcoded legacyWorkers parameter.

Ref: rishikanthc/Scriberr#379

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:38:09 -07:00
rishikanthc
c44de7858b refactor: Complete repository pattern migration for all remaining files (Phases 5-7)
Phase 5: Refactor queue.go (10 DB calls removed)
- Added JobRepository to TaskQueue struct and constructor
- Added UpdateStatus, UpdateError, FindByStatus, CountByStatus methods to JobRepository
- Replaced all database.DB calls with repository methods

Phase 6: Refactor chat_handlers.go and summarize_handlers.go (6 DB calls removed)
- Added GetMessageCountsBySessionIDs and GetLastMessagesBySessionIDs to ChatRepository
- Added UpdateSummary to JobRepository
- Replaced batch queries and update calls with repository methods
- Removed database import from both files

Phase 7: Refactor quick_transcription.go (3 DB calls removed)
- Added JobRepository injection to QuickTranscriptionService
- Updated constructor and all callers

Summary: 46+ database.DB calls replaced with repository methods across 7 phases.
All tests pass, build succeeds.
2025-12-16 18:21:36 -08:00
rishikanthc
7fc7619ee6 fix: tests for upstream changes
fix: new tests for chat and user management flows

fix: resolve lint errors

fix: configured lefthook to check entire project
2025-12-16 18:21:36 -08:00
rishikanthc
658a1a5c49 fix: lint errors in go code 2025-12-16 18:21:36 -08:00
rishikanthc
201b3b787c fix: remove timer-based job scanner that caused duplicate transcriptions
The jobScanner was running every 10 seconds and re-enqueueing jobs that
were already in the queue but hadn't started processing yet. This caused
completed files to be re-transcribed when auto-transcribe was enabled.

Changes:
- Removed jobScanner goroutine (10-second polling loop)
- Removed scanPendingJobs function
- Added recoverPendingJobs that runs ONCE at startup to recover
  any pending jobs left from previous server runs
- Jobs are now only enqueued when explicitly requested:
  - Upload with auto-transcribe enabled
  - Manual transcription start
  - Server restart recovery (one-time)
2025-12-14 19:09:52 -08:00
rishikanthc
377ac4fd12 fixes #232 2025-11-25 09:12:28 -08:00
rishikanthc
2b24e08055 improves logging 2025-09-11 10:32:36 -07:00
rishikanthc
74d4dc5995 fixes multi-track transcription 2025-09-11 08:48:43 -07:00
rishikanthc
0bb41c41ec optimizes backend for performance 2025-09-08 09:56:03 -07:00
rishikanthc
ce0b85fa23 adds support for video transcription - formatter run touched all files 2025-09-07 18:24:00 -07:00
rishikanthc
3d3931bbc5 prepares for package release 2025-09-05 09:29:19 -07:00
rishikanthc
dc412807b1 fixes go releaser syscall related errors during packaging 2025-09-05 09:01:40 -07:00
rishikanthc
c2de028627 fixes job termination 2025-09-01 19:52:43 -07:00
rishikanthc
38db957232 implements configuration profiles 2025-08-23 19:02:05 -07:00
rishikanthc
96aeaf1454 basic UI 2025-08-21 15:48:55 -07:00