aboutsummaryrefslogtreecommitdiffstats
path: root/services/mirror
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /services/mirror
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
Diffstat (limited to 'services/mirror')
-rw-r--r--services/mirror/mirror.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go
index 7c3d0d2239..a2acb6f363 100644
--- a/services/mirror/mirror.go
+++ b/services/mirror/mirror.go
@@ -8,6 +8,7 @@ import (
"context"
"fmt"
"net/url"
+ "strconv"
"strings"
"time"
@@ -22,8 +23,6 @@ import (
"code.gitea.io/gitea/modules/sync"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
-
- "github.com/unknwon/com"
)
// mirrorQueue holds an UniqueQueue object of the mirror
@@ -396,11 +395,11 @@ func syncMirror(repoID string) {
}()
mirrorQueue.Remove(repoID)
- m, err := models.GetMirrorByRepoID(com.StrTo(repoID).MustInt64())
+ id, _ := strconv.ParseInt(repoID, 10, 64)
+ m, err := models.GetMirrorByRepoID(id)
if err != nil {
log.Error("GetMirrorByRepoID [%s]: %v", repoID, err)
return
-
}
log.Trace("SyncMirrors [repo: %-v]: Running Sync", m.Repo)