mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-25 00:05:03 +01:00
undo whitespace change, add comments
This commit is contained in:
@@ -26,7 +26,6 @@ type Reporter struct {
|
|||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
|
|
||||||
closed bool
|
closed bool
|
||||||
|
|
||||||
client client.Client
|
client client.Client
|
||||||
clientM sync.Mutex
|
clientM sync.Mutex
|
||||||
|
|
||||||
@@ -300,7 +299,8 @@ func (r *Reporter) ReportLog(noMore bool) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReportState reports the current task state unless the reporter is closed.
|
// ReportState skips when closed so RunDaemon cannot send a completed state
|
||||||
|
// before Close sends the final logs.
|
||||||
func (r *Reporter) ReportState() error {
|
func (r *Reporter) ReportState() error {
|
||||||
r.stateMu.RLock()
|
r.stateMu.RLock()
|
||||||
closed := r.closed
|
closed := r.closed
|
||||||
@@ -311,6 +311,7 @@ func (r *Reporter) ReportState() error {
|
|||||||
return r.reportState()
|
return r.reportState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reportState sends unconditionally. Used by Close after final logs are uploaded.
|
||||||
func (r *Reporter) reportState() error {
|
func (r *Reporter) reportState() error {
|
||||||
r.clientM.Lock()
|
r.clientM.Lock()
|
||||||
defer r.clientM.Unlock()
|
defer r.clientM.Unlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user