admin: Refactor synchronization status report + display last git error

This commit is contained in:
nemunaire 2025-01-13 18:00:27 +01:00
parent c1924c0e92
commit 03d02669ea
6 changed files with 81 additions and 49 deletions

View file

@ -24,6 +24,22 @@ var oneThemeDeepSync sync.Mutex
// DeepSyncProgress expose the progression of the depp synchronization (0 = 0%, 255 = 100%).
var DeepSyncProgress uint8
func OneDeepSyncStatus() bool {
if oneDeepSync.TryLock() {
oneDeepSync.Unlock()
return true
}
return false
}
func OneThemeDeepSyncStatus() bool {
if oneThemeDeepSync.TryLock() {
oneThemeDeepSync.Unlock()
return true
}
return false
}
type SyncReport struct {
DateStart time.Time `json:"_started"`
DateEnd time.Time `json:"_ended"`