mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-20 23:41:23 +02:00
idlewatfcher: add proper Cache-Control Headers to response
This commit is contained in:
@@ -32,6 +32,7 @@ type (
|
||||
client *D.SharedClient
|
||||
stopByMethod StopCallback // send a docker command w.r.t. `stop_method`
|
||||
ticker *time.Ticker
|
||||
lastReset time.Time
|
||||
task *task.Task
|
||||
}
|
||||
|
||||
@@ -207,6 +208,11 @@ func (w *Watcher) getStopCallback() StopCallback {
|
||||
func (w *Watcher) resetIdleTimer() {
|
||||
w.Trace().Msg("reset idle timer")
|
||||
w.ticker.Reset(w.IdleTimeout)
|
||||
w.lastReset = time.Now()
|
||||
}
|
||||
|
||||
func (w *Watcher) expires() time.Time {
|
||||
return w.lastReset.Add(w.IdleTimeout)
|
||||
}
|
||||
|
||||
func (w *Watcher) getEventCh(dockerWatcher watcher.DockerWatcher) (eventCh <-chan events.Event, errCh <-chan E.Error) {
|
||||
|
||||
Reference in New Issue
Block a user