admin: Refactor synchronization status report + display last git error
This commit is contained in:
parent
cc725c8e8f
commit
51f60e59d4
6 changed files with 81 additions and 49 deletions
|
|
@ -12,6 +12,14 @@ var gitRemoteRe = regexp.MustCompile(`^(?:(?:git@|https://)([\w.@]+)(?:/|:))((?:
|
|||
|
||||
var oneGitPull sync.Mutex
|
||||
|
||||
func OneGitPullStatus() bool {
|
||||
if oneGitPull.TryLock() {
|
||||
oneGitPull.Unlock()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func countFileInDir(dirname string) (int, error) {
|
||||
files, err := os.ReadDir(dirname)
|
||||
if err != nil {
|
||||
|
|
|
|||
Reference in a new issue