diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:24:42 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-19 16:28:43 +0200 |
commit | b242ed3c44f4dde7c4b452312b78a3b02f42ea65 (patch) | |
tree | 1a9cc1b68e4a94e530c5e2596c645a698c4a656e /pkg/worker/list_processor_test.go | |
parent | 84f80cdc4d27c3274c74f98255bf90c713e89a85 (diff) | |
download | lens-b242ed3c44f4dde7c4b452312b78a3b02f42ea65.tar.gz lens-b242ed3c44f4dde7c4b452312b78a3b02f42ea65.tar.bz2 lens-b242ed3c44f4dde7c4b452312b78a3b02f42ea65.zip |
feat: Add task loop
Now the tasks will loop every given time. With this it will be able to
pick up new photos after the application was started.
I added 2h for file because my personal photo gallery is quite big and
quite IO bottled necked so it tasks a lot of time to go through.
Diffstat (limited to 'pkg/worker/list_processor_test.go')
-rw-r--r-- | pkg/worker/list_processor_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/worker/list_processor_test.go b/pkg/worker/list_processor_test.go index ce3ff0a..abdb907 100644 --- a/pkg/worker/list_processor_test.go +++ b/pkg/worker/list_processor_test.go @@ -32,7 +32,7 @@ func TestListProcessorLimit(t *testing.T) { mock = &mockCounterListProcessor{countTo: 10000} ) - worker := NewWorkerFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) + worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) err := worker.Start(context.Background()) testkit.TestFatalError(t, "Start", err) @@ -47,7 +47,7 @@ func TestListProcessorContextCancelQuery(t *testing.T) { mock = &mockContextListProcessor{} ) - worker := NewWorkerFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) + worker := NewTaskFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup |