mirror of
https://github.com/postgres/postgres.git
synced 2026-03-06 15:25:15 -05:00
Simplify some code in logical replication launcher
Avoid unnecessary locking calls when a subscription is disabled. Author: Yugo Nagata <nagata@sraoss.co.jp>
This commit is contained in:
parent
270fec9f0b
commit
e42351ae07
1 changed files with 4 additions and 1 deletions
|
|
@ -929,11 +929,14 @@ ApplyLauncherMain(Datum main_arg)
|
|||
Subscription *sub = (Subscription *) lfirst(lc);
|
||||
LogicalRepWorker *w;
|
||||
|
||||
if (!sub->enabled)
|
||||
continue;
|
||||
|
||||
LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);
|
||||
w = logicalrep_worker_find(sub->oid, InvalidOid, false);
|
||||
LWLockRelease(LogicalRepWorkerLock);
|
||||
|
||||
if (sub->enabled && w == NULL)
|
||||
if (w == NULL)
|
||||
{
|
||||
last_start_time = now;
|
||||
wait_time = wal_retrieve_retry_interval;
|
||||
|
|
|
|||
Loading…
Reference in a new issue