Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/email-template/cla-updated.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Dear {{.AdminName}},

A new version of CLA is published. Please login to the CLA management system to see the details.

The CLA management system login URL is {{.URLOfCLAPlatform}}.
The CLA management system login URL is {{.URLOfCLAPlatform}}

Have questions or need help? Just reply to this email and the {{.Org}} Community Support Team will help you sort it out.

Expand Down
3 changes: 0 additions & 3 deletions signing/app/cla.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/opensourceways/app-cla-server/signing/domain/claservice"
"github.com/opensourceways/app-cla-server/signing/domain/dp"
"github.com/opensourceways/app-cla-server/signing/domain/repository"
"github.com/opensourceways/app-cla-server/signing/watch"
)

func NewCLAService(
Expand Down Expand Up @@ -66,8 +65,6 @@ func (s *claService) Update(cmd *CmdToUpdateCLA) error {
logs.Error("set pending CLA for link failed: %s, err: %v", cmd.LinkId, err)
}

watch.TriggerNotify()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要把冗余代码一起删掉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经删除了


return nil
}

Expand Down
30 changes: 2 additions & 28 deletions signing/watch/notify_corp_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ func NotifyAdminWatchStart(cfg *NotifyAdminConfig, lk repoLink, corp corpSigning
claPlatformURL: claPlatformURL,
defaultGracePeriodDays: defaultGracePeriodDays,
stop: make(chan struct{}),
corpTrigger: make(chan struct{}, 1),
individualTrigger: make(chan struct{}, 1),
}

notifyAdminWatchInstance.start()
Expand All @@ -41,22 +39,6 @@ func NotifyAdminWatchStop() {
}
}

// TriggerNotify 立即触发一次通知扫描,不等待定时器周期。
// CLA 更新后应调用此函数,确保企业和个人都在最短时间内收到通知。
func TriggerNotify() {
if notifyAdminWatchInstance == nil {
return
}
select {
case notifyAdminWatchInstance.corpTrigger <- struct{}{}:
default:
}
select {
case notifyAdminWatchInstance.individualTrigger <- struct{}{}:
default:
}
}

type corpSigningRepo interface {
FindAll(linkId string) ([]repository.CorpSigningSummary, error)
UpdateCLANotify(summary *repository.CorpSigningSummary) error
Expand All @@ -77,10 +59,8 @@ type notifyAdminWatchImpl struct {

defaultGracePeriodDays int

wg sync.WaitGroup
stop chan struct{}
corpTrigger chan struct{}
individualTrigger chan struct{}
wg sync.WaitGroup
stop chan struct{}
}

func (impl *notifyAdminWatchImpl) start() {
Expand Down Expand Up @@ -109,9 +89,6 @@ func (impl *notifyAdminWatchImpl) notifyCorpAdmin() {
case <-timer.C:
impl.handleNotifyJob()
timer.Reset(impl.nextDelay(interval))
case <-impl.corpTrigger:
impl.handleNotifyJob()
timer.Reset(impl.nextDelay(interval))
}
}
}
Expand Down Expand Up @@ -272,9 +249,6 @@ func (impl *notifyAdminWatchImpl) notifyIndividualSigner() {
case <-timer.C:
impl.handleIndividualNotifyJob()
timer.Reset(impl.nextDelay(interval))
case <-impl.individualTrigger:
impl.handleIndividualNotifyJob()
timer.Reset(impl.nextDelay(interval))
}
}
}
Expand Down
Loading