mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Config: Reduce MinWakeupInterval from 1m to 1s
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -713,7 +713,7 @@ func (c *Config) IndexSchedule() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WakeupInterval returns the duration between background worker runs
|
// WakeupInterval returns the duration between background worker runs
|
||||||
// required for face recognition and index maintenance(1-86400s).
|
// required for face recognition and index maintenance (1-86400s).
|
||||||
func (c *Config) WakeupInterval() time.Duration {
|
func (c *Config) WakeupInterval() time.Duration {
|
||||||
if c.options.WakeupInterval <= 0 {
|
if c.options.WakeupInterval <= 0 {
|
||||||
if c.Unsafe() {
|
if c.Unsafe() {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const DefaultAutoIndexDelay = 300 // 5 Minutes
|
|||||||
const DefaultAutoImportDelay = -1 // Disabled
|
const DefaultAutoImportDelay = -1 // Disabled
|
||||||
|
|
||||||
// MinWakeupInterval is the minimum allowed interval for the background worker.
|
// MinWakeupInterval is the minimum allowed interval for the background worker.
|
||||||
const MinWakeupInterval = time.Minute // 1 Minute
|
const MinWakeupInterval = time.Second // 1 Second
|
||||||
// MaxWakeupInterval is the maximum allowed interval for the background worker.
|
// MaxWakeupInterval is the maximum allowed interval for the background worker.
|
||||||
const MaxWakeupInterval = time.Hour * 24 // 1 Day
|
const MaxWakeupInterval = time.Hour * 24 // 1 Day
|
||||||
// DefaultWakeupIntervalSeconds is the default worker interval in seconds.
|
// DefaultWakeupIntervalSeconds is the default worker interval in seconds.
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ func TestConfig_WakeupInterval(t *testing.T) {
|
|||||||
|
|
||||||
c.options.WakeupInterval = 45
|
c.options.WakeupInterval = 45
|
||||||
|
|
||||||
assert.Equal(t, "1m0s", c.WakeupInterval().String())
|
assert.Equal(t, "45s", c.WakeupInterval().String())
|
||||||
|
|
||||||
c.options.WakeupInterval = 0
|
c.options.WakeupInterval = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user