/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/mutex/atomic_test.go
21 строка
534 B
Michael Mayer
Download: Expire temporary archives and gate the sweep worker
27 июл 2026, 15:12
27 июл 2026, 15:12
4bcd670
Код
Авторство
О чём код?
package mutex import ( "testing" "github.com/stretchr/testify/assert" ) func TestTempArchives(t *testing.T) { t.Run("DefaultsToTrue", func(t *testing.T) { // Starts set so the first sweep after a restart also covers archives left by a previous process. assert.True(t, TempArchives.Load()) }) t.Run("StoreAndLoad", func(t *testing.T) { t.Cleanup(func() { TempArchives.Store(true) }) TempArchives.Store(false) assert.False(t, TempArchives.Load()) TempArchives.Store(true) assert.True(t, TempArchives.Load()) }) }