worker: добавлен пакет worker (W1-W5, poll-цикл, runTask, промпт, тесты) + SetMaxOpenConns(1) для SQLITE_BUSY
All checks were successful
build-test / build (push) Successful in 42s

This commit is contained in:
Hermes
2026-08-15 09:14:34 +05:00
parent dfe374dd55
commit 4641090398
6 changed files with 627 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ func Open(ctx context.Context, path string) (*Storage, error) {
if err != nil {
return nil, fmt.Errorf("%w: open: %w", ErrDB, err)
}
// Один connection — сериализует доступ, исключает SQLITE_BUSY
// при конкурентной записи из нескольких горутин (worker).
db.SetMaxOpenConns(1)
// Прагмы: WAL + синхронность
pragmas := []string{
"PRAGMA journal_mode=WAL",