Skip to content

Commit 433e287

Browse files
committed
fix gocron task scheduling
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 385d4bc commit 433e287

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • token/services/network/fabricx/lookup

token/services/network/fabricx/lookup/gocron.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ func (n *CronListenerManager) PermanentLookupListenerSupported() bool {
7373
func (n *CronListenerManager) AddPermanentLookupListener(namespace string, key string, listener Listener) error {
7474
logger.Infof("AddPermanentLookupListener [%s:%s]", namespace, key)
7575

76+
job := NewPermanentJob(namespace, key, listener, n.queryService)
7677
j, err := n.scheduler.NewJob(
7778
gocron.DurationJob(n.config.PermanentInterval()),
78-
gocron.NewTask(NewPermanentJob(namespace, key, listener, n.queryService)),
79+
gocron.NewTask(job.Run),
7980
gocron.WithSingletonMode(gocron.LimitModeReschedule),
8081
)
8182
if err != nil {

0 commit comments

Comments
 (0)