add etl.RunOnStartup

This commit is contained in:
Sam Lewis
2022-11-09 20:16:35 -05:00
parent f7e212e1d1
commit 7fda113913
2 changed files with 29 additions and 4 deletions

View File

@@ -24,9 +24,10 @@ type EntityListener struct {
exceptionDays []time.Time
exceptionRanges []timeRange
}
// TODO: add RunOnStartup() to etl, evl, schedule
runOnStartup bool
runOnStartupCompleted bool
}
type EntityListenerCallback func(*Service, *State, EntityData)
@@ -142,6 +143,11 @@ func (b elBuilder3) ExceptionRange(start, end time.Time) elBuilder3 {
return b
}
func (b elBuilder3) RunOnStartup() elBuilder3 {
b.entityListener.runOnStartup = true
return b
}
func (b elBuilder3) Build() EntityListener {
return b.entityListener
}