fix media workflows and download organization

This commit is contained in:
ShukeBta
2026-06-26 08:42:16 +08:00
parent 0da96f7e4e
commit 65adca04df
102 changed files with 4063 additions and 437 deletions
+15
View File
@@ -5,6 +5,7 @@ import (
"errors"
"os"
"path/filepath"
"strings"
"sync/atomic"
"testing"
"time"
@@ -189,6 +190,20 @@ func TestSchedulerRunNowAsyncRejectsDuplicateRun(t *testing.T) {
close(release)
}
func TestSchedulerStartDoesNotRegisterSubscriptionPullJob(t *testing.T) {
scheduler := NewSchedulerService(zap.NewNop(), nil, nil, nil, nil, nil, nil, "")
ctx, cancel := context.WithCancel(t.Context())
cancel()
scheduler.Start(ctx)
defer scheduler.Stop()
for _, status := range scheduler.Status() {
if strings.Contains(status.Name, "subscription") {
t.Fatalf("scheduler registered subscription job %q; subscriptions must be owned by SubscriptionService only", status.Name)
}
}
}
func TestSchedulerOrganizeSourceSyncsVisibilityWhenTargetAlreadyExists(t *testing.T) {
root := t.TempDir()
src := filepath.Join(root, "downloads")