this did not work

This commit is contained in:
Robin Olsen
2026-04-03 12:59:17 +02:00
parent 5d3fa86627
commit 88f4998601
2 changed files with 0 additions and 70 deletions

View File

@@ -104,46 +104,9 @@ func (t *GitTask) Setup(ctx context.Context) error {
return err
}
// Initialize lastModified and start file watcher
if stat, err := os.Stat("./task/README.md"); err == nil {
t.lastModified = stat.ModTime()
}
t.startFileWatcher(ctx)
return nil
}
func (t *GitTask) startFileWatcher(ctx context.Context) {
go func() {
ticker := time.NewTicker(2 * time.Second)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
if t.app.SubmitChan == nil {
continue
}
stat, err := os.Stat("./task/README.md")
if err != nil {
continue
}
if stat.ModTime().After(t.lastModified) {
t.lastModified = stat.ModTime()
select {
case t.app.SubmitChan <- models.ValidationTrigger{Source: models.ValidationTriggerAutoPoll}:
default:
}
}
}
}
}()
}
func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
expect := check.NewExpector()