File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,11 @@ const Label = "github.com.pace.bricks.activepassive"
4141type ActivePassive struct {
4242 // OnActive will be called in case the current processes
4343 // is elected to be the active one
44- OnActive func ()
44+ OnActive func (ctx context. Context )
4545
4646 // OnPassive will be called in case the current process is
4747 // the passive one
48- OnPassive func ()
48+ OnPassive func (ctx context. Context )
4949
5050 // OnStop is called after the ActivePassive process stops
5151 OnStop func ()
@@ -203,15 +203,15 @@ func (a *ActivePassive) label(s status) string {
203203func (a * ActivePassive ) becomeActive (ctx context.Context ) {
204204 if a .setState (ctx , ACTIVE ) {
205205 if a .OnActive != nil {
206- a .OnActive ()
206+ a .OnActive (ctx )
207207 }
208208 }
209209}
210210
211211func (a * ActivePassive ) becomePassive (ctx context.Context ) {
212212 if a .setState (ctx , PASSIVE ) {
213213 if a .OnPassive != nil {
214- a .OnPassive ()
214+ a .OnPassive (ctx )
215215 }
216216 }
217217}
You can’t perform that action at this time.
0 commit comments