worker: добавлен пакет worker (W1-W5, poll-цикл, runTask, промпт, тесты) + SetMaxOpenConns(1) для SQLITE_BUSY
All checks were successful
build-test / build (push) Successful in 42s
All checks were successful
build-test / build (push) Successful in 42s
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user