admin: Refactor synchronization status report + display last git error
This commit is contained in:
parent
c1924c0e92
commit
03d02669ea
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