1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
6543
2020-12-25 09:59:32 +00:00
committed by GitHub
parent 04ae0f2f3f
commit a19447aed1
46 changed files with 230 additions and 220 deletions

View File

@@ -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)