|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"errors" |
|
|
|
"time" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
@@ -286,6 +287,13 @@ func UpdateRepoVisits(ctx *macaron.Context, repo *models.Repository, date string |
|
|
|
} |
|
|
|
|
|
|
|
repoStat, err := models.GetRepoStatisticByDate(date, repo.ID) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetRepoStatisticByDate failed(%s): %v", getDistinctProjectName(repo), err) |
|
|
|
return err |
|
|
|
} else if len(repoStat) != 1 { |
|
|
|
log.Error("GetRepoStatisticByDate failed(%s): %v", getDistinctProjectName(repo), err) |
|
|
|
return errors.New("not find repo") |
|
|
|
} |
|
|
|
repoStat[0].NumVisits = int64(numVisits) |
|
|
|
|
|
|
|
if err = models.UpdateRepoStatVisits(repoStat[0]); err != nil { |
|
|
|
|