Self-Contained Design

To prove the system is truly self-contained:
To add a new task:
Create a task package (e.g., worker/tasks/compression/)
Import it: _ "github.com/.../worker/tasks/compression"
That's it! No other changes needed.
To remove a task:
Delete the task package directory
Remove the import line
That's it! No other changes needed.
This commit is contained in:
chrislu committed 2025-08-10 00:15:26 -07:00
1 parent 96d6d27607
commit 05a0cc156b
14 files changed
+197 -88

No files matched your search

+4
View File
@@ -25,6 +25,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/worker/tasks"
)
var (
@@ -229,6 +230,9 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
fmt.Printf("Data directory created/verified: %s\n", dataDir)
}
// Initialize dynamic task type functions now that all tasks are registered
tasks.InitializeDynamicTaskTypes()
// Create admin server
adminServer := dash.NewAdminServer(*options.masters, nil, dataDir)