replace unnecessary Task interface with struct

This commit is contained in:
yusing
2024-12-17 09:32:51 +08:00
parent 4d94d12e9c
commit c5d96f96e1
15 changed files with 106 additions and 112 deletions

View File

@@ -27,7 +27,7 @@ type (
impl
*Config
task task.Task
task *task.Task
pool Pool
poolMu sync.Mutex
@@ -52,7 +52,7 @@ func New(cfg *Config) *LoadBalancer {
}
// Start implements task.TaskStarter.
func (lb *LoadBalancer) Start(routeSubtask task.Task) E.Error {
func (lb *LoadBalancer) Start(routeSubtask *task.Task) E.Error {
lb.startTime = time.Now()
lb.task = routeSubtask
lb.task.OnFinished("loadbalancer cleanup", func() {

View File

@@ -73,7 +73,7 @@ func loadContent() {
}
}
func watchDir(task task.Task) {
func watchDir(task *task.Task) {
eventCh, errCh := dirWatcher.Events(task.Context())
for {
select {

View File

@@ -24,7 +24,7 @@ type Server struct {
httpsStarted bool
startTime time.Time
task task.Task
task *task.Task
l zerolog.Logger
}