Skip to content

Commit 488469d

Browse files
committed
move shouldRefresh check before recordsToRefresh.push
1 parent 0f493a5 commit 488469d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/ipns/src/ipns/republisher.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ export class IPNSRepublisher {
101101
}
102102

103103
if (metadata.refresh) {
104+
if (!shouldRefresh(created)) {
105+
this.log.trace(`skipping record ${routingKey.toString()} within republish threshold`)
106+
continue
107+
}
104108
recordsToRefresh.push({ routingKey, created })
105109
continue
106110
}
@@ -164,11 +168,6 @@ export class IPNSRepublisher {
164168
continue
165169
}
166170

167-
if (!shouldRefresh(created)) {
168-
this.log.trace(`skipping record ${routingKey.toString()} within republish threshold`)
169-
continue
170-
}
171-
172171
// Add job to queue to republish the existing record to all routers
173172
queue.add(async () => {
174173
try {

0 commit comments

Comments
 (0)