mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-24 15:55:03 +01:00
fixes #793
This commit is contained in:
@@ -26,6 +26,8 @@ type Reporter struct {
|
|||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
|
|
||||||
closed bool
|
closed bool
|
||||||
|
closedM sync.Mutex
|
||||||
|
|
||||||
client client.Client
|
client client.Client
|
||||||
clientM sync.Mutex
|
clientM sync.Mutex
|
||||||
|
|
||||||
@@ -184,7 +186,13 @@ func (r *Reporter) RunDaemon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = r.ReportLog(false)
|
_ = r.ReportLog(false)
|
||||||
_ = r.ReportState()
|
|
||||||
|
r.closedM.Lock()
|
||||||
|
defer r.closedM.Unlock()
|
||||||
|
|
||||||
|
if !r.closed {
|
||||||
|
_ = r.ReportState()
|
||||||
|
}
|
||||||
|
|
||||||
time.AfterFunc(time.Second, r.RunDaemon)
|
time.AfterFunc(time.Second, r.RunDaemon)
|
||||||
}
|
}
|
||||||
@@ -226,7 +234,9 @@ func (r *Reporter) SetOutputs(outputs map[string]string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Reporter) Close(lastWords string) error {
|
func (r *Reporter) Close(lastWords string) error {
|
||||||
|
r.closedM.Lock()
|
||||||
r.closed = true
|
r.closed = true
|
||||||
|
r.closedM.Unlock()
|
||||||
|
|
||||||
r.stateMu.Lock()
|
r.stateMu.Lock()
|
||||||
if r.state.Result == runnerv1.Result_RESULT_UNSPECIFIED {
|
if r.state.Result == runnerv1.Result_RESULT_UNSPECIFIED {
|
||||||
|
|||||||
Reference in New Issue
Block a user