MCPcopy Create free account
hub / github.com/gogs/gogs / AfterSet

Method AfterSet

internal/database/mirror.go:67–80  ·  view source on GitHub ↗
(colName string, _ xorm.Cell)

Source from the content-addressed store, hash-verified

65}
66
67func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
68 var err error
69 switch colName {
70 case "repo_id":
71 m.Repo, err = GetRepositoryByID(m.RepoID)
72 if err != nil {
73 log.Error("GetRepositoryByID [%d]: %v", m.ID, err)
74 }
75 case "updated_unix":
76 m.LastSync = time.Unix(m.LastSyncUnix, 0).Local()
77 case "next_update_unix":
78 m.NextSync = time.Unix(m.NextSyncUnix, 0).Local()
79 }
80}
81
82// ScheduleNextSync calculates and sets next sync time based on repository mirror setting.
83func (m *Mirror) ScheduleNextSync() {

Callers

nothing calls this directly

Calls 2

GetRepositoryByIDFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected