ingredient/info: Add Fetcher concept
This commit is contained in:
parent
a6501b42c7
commit
52559e4d68
22 changed files with 447 additions and 328 deletions
|
|
@ -3,6 +3,7 @@ package drush
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/php"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
"github.com/tkw1536/goprogram/stream"
|
||||
|
|
@ -35,3 +36,18 @@ func (drush *Drush) LastCron(server *php.Server) (t time.Time, err error) {
|
|||
}
|
||||
return time.Unix(timestamp, 0), nil
|
||||
}
|
||||
|
||||
type LastCronFetcher struct {
|
||||
ingredient.Base
|
||||
|
||||
Drush *Drush
|
||||
}
|
||||
|
||||
func (lbr *LastCronFetcher) Fetch(flags ingredient.FetchFlags, info *ingredient.Information) (err error) {
|
||||
if flags.Quick {
|
||||
return
|
||||
}
|
||||
|
||||
info.LastRebuild, _ = lbr.Drush.LastCron(flags.Server)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue