Skip to content

Commit b3828e3

Browse files
committed
more
1 parent 05fd9d3 commit b3828e3

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

models/mail.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ const (
2323
MailAuthActivate base.TplName = "auth/activate"
2424
MailAuthActivateEmail base.TplName = "auth/activate_email"
2525
MailAuthResetPassword base.TplName = "auth/reset_passwd"
26-
MAIL_AUTH_REGISTER_NOTIFY base.TplName = "auth/register_notify"
26+
MailAuthRegisterNotify base.TplName = "auth/register_notify"
2727

28-
MAIL_ISSUE_COMMENT base.TplName = "issue/comment"
29-
MAIL_ISSUE_MENTION base.TplName = "issue/mention"
28+
MailIssueComment base.TplName = "issue/comment"
29+
MailIssueMention base.TplName = "issue/mention"
3030

31-
MAIL_NOTIFY_COLLABORATOR base.TplName = "notify/collaborator"
31+
MailNotifyCollaborator base.TplName = "notify/collaborator"
3232
)
3333

3434
type MailRender interface {
@@ -109,7 +109,7 @@ func SendRegisterNotifyMail(c *macaron.Context, u *User) {
109109
data := map[string]interface{}{
110110
"Username": u.DisplayName(),
111111
}
112-
body, err := mailRender.HTMLString(string(MAIL_AUTH_REGISTER_NOTIFY), data)
112+
body, err := mailRender.HTMLString(string(MailAuthRegisterNotify), data)
113113
if err != nil {
114114
log.Error(3, "HTMLString: %v", err)
115115
return
@@ -131,7 +131,7 @@ func SendCollaboratorMail(u, doer *User, repo *Repository) {
131131
"RepoName": repoName,
132132
"Link": repo.HTMLURL(),
133133
}
134-
body, err := mailRender.HTMLString(string(MAIL_NOTIFY_COLLABORATOR), data)
134+
body, err := mailRender.HTMLString(string(MailNotifyCollaborator), data)
135135
if err != nil {
136136
log.Error(3, "HTMLString: %v", err)
137137
return
@@ -171,13 +171,13 @@ func SendIssueCommentMail(issue *Issue, doer *User, tos []string) {
171171
return
172172
}
173173

174-
mailer.SendAsync(composeIssueMessage(issue, doer, MAIL_ISSUE_COMMENT, tos, "issue comment"))
174+
mailer.SendAsync(composeIssueMessage(issue, doer, MailIssueComment, tos, "issue comment"))
175175
}
176176

177177
// SendIssueMentionMail composes and sends issue mention emails to target receivers.
178178
func SendIssueMentionMail(issue *Issue, doer *User, tos []string) {
179179
if len(tos) == 0 {
180180
return
181181
}
182-
mailer.SendAsync(composeIssueMessage(issue, doer, MAIL_ISSUE_MENTION, tos, "issue mention"))
182+
mailer.SendAsync(composeIssueMessage(issue, doer, MailIssueMention, tos, "issue mention"))
183183
}

models/repo.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,18 +1613,18 @@ func RewriteRepositoryUpdateHook() error {
16131613
var taskStatusTable = sync.NewStatusTable()
16141614

16151615
const (
1616-
_MIRROR_UPDATE = "mirror_update"
1617-
_GIT_FSCK = "git_fsck"
1618-
_CHECK_REPOs = "check_repos"
1616+
mirrorUpdate = "mirror_update"
1617+
gitFsck = "git_fsck"
1618+
checkRepos = "check_repos"
16191619
)
16201620

16211621
// GitFsck calls 'git fsck' to check repository health.
16221622
func GitFsck() {
1623-
if taskStatusTable.IsRunning(_GIT_FSCK) {
1623+
if taskStatusTable.IsRunning(gitFsck) {
16241624
return
16251625
}
1626-
taskStatusTable.Start(_GIT_FSCK)
1627-
defer taskStatusTable.Stop(_GIT_FSCK)
1626+
taskStatusTable.Start(gitFsck)
1627+
defer taskStatusTable.Stop(gitFsck)
16281628

16291629
log.Trace("Doing: GitFsck")
16301630

@@ -1686,11 +1686,11 @@ func repoStatsCheck(checker *repoChecker) {
16861686
}
16871687

16881688
func CheckRepoStats() {
1689-
if taskStatusTable.IsRunning(_CHECK_REPOs) {
1689+
if taskStatusTable.IsRunning(checkRepos) {
16901690
return
16911691
}
1692-
taskStatusTable.Start(_CHECK_REPOs)
1693-
defer taskStatusTable.Stop(_CHECK_REPOs)
1692+
taskStatusTable.Start(checkRepos)
1693+
defer taskStatusTable.Stop(checkRepos)
16941694

16951695
log.Trace("Doing: CheckRepoStats")
16961696

models/repo_mirror.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ func DeleteMirrorByRepoID(repoID int64) error {
191191

192192
// MirrorUpdate checks and updates mirror repositories.
193193
func MirrorUpdate() {
194-
if taskStatusTable.IsRunning(_MIRROR_UPDATE) {
194+
if taskStatusTable.IsRunning(mirrorUpdate) {
195195
return
196196
}
197-
taskStatusTable.Start(_MIRROR_UPDATE)
198-
defer taskStatusTable.Stop(_MIRROR_UPDATE)
197+
taskStatusTable.Start(mirrorUpdate)
198+
defer taskStatusTable.Stop(mirrorUpdate)
199199

200200
log.Trace("Doing: MirrorUpdate")
201201

0 commit comments

Comments
 (0)