feat: restart to apply update, privileged helper, rollback
This commit is contained in:
1 parent
70460e4170
commit
54e8fd5fed
63 files changed
+8635
-164
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"RenewCMS/internal/domain/update"
|
||||
"time"
|
||||
)
|
||||
|
||||
type RecordRunningInfoUseCase struct {
|
||||
store update.RunningInfoStore
|
||||
version string
|
||||
pid int
|
||||
now func() time.Time
|
||||
}
|
||||
|
||||
func NewRecordRunningInfoUseCase(store update.RunningInfoStore, version string, pid int, now func() time.Time) *RecordRunningInfoUseCase {
|
||||
return &RecordRunningInfoUseCase{store: store, version: version, pid: pid, now: now}
|
||||
}
|
||||
|
||||
func (r *RecordRunningInfoUseCase) Record() error {
|
||||
return r.store.Write(update.RunningInfo{Version: r.version, Pid: r.pid, StartedAt: r.now().UTC()})
|
||||
}
|
||||
Reference in new issue
Block a user