Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 773a9e1

Browse files
committed
Fix restart raftable
1 parent babf91f commit 773a9e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

contrib/raftable/worker.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,17 @@ static void worker_main(Datum arg)
486486
}
487487
}
488488

489+
static BackgroundWorker RaftableWorker = {
490+
"raftable worker",
491+
BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION, /* do not need connection to the database */
492+
BgWorkerStart_ConsistentState,
493+
1,
494+
worker_main
495+
};
496+
489497
void worker_register(WorkerConfig *cfg)
490498
{
499+
#if 0
491500
BackgroundWorker worker = {};
492501
strcpy(worker.bgw_name, "raftable worker");
493502
worker.bgw_flags = BGWORKER_SHMEM_ACCESS;
@@ -496,6 +505,10 @@ void worker_register(WorkerConfig *cfg)
496505
worker.bgw_main = worker_main;
497506
worker.bgw_main_arg = PointerGetDatum(cfg);
498507
RegisterBackgroundWorker(&worker);
508+
#else
509+
RaftableWorker.bgw_main_arg = PointerGetDatum(cfg);
510+
RegisterBackgroundWorker(&RaftableWorker);
511+
#endif
499512
}
500513

501514

0 commit comments

Comments
 (0)