We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bf6163 commit 1bfa6c5Copy full SHA for 1bfa6c5
1 file changed
pkg/database/disc.go
@@ -218,15 +218,19 @@ func (db *DB) fetchExecutionNodesToCrawl(ctx context.Context) error {
218
rows, err := db.pg.Query(
219
ctx,
220
`
221
+ WITH last_crawled AS (
222
+ SELECT node_id
223
+ FROM crawler.next_disc_crawl
224
+ WHERE last_found > now() - INTERVAL '48 hours'
225
+ )
226
SELECT
227
next_node_crawl.next_crawl,
228
node_record
229
FROM crawler.next_node_crawl
- LEFT JOIN disc.nodes USING (node_id)
- LEFT JOIN crawler.next_disc_crawl USING (node_id)
230
+ INNER JOIN crawler.next_disc_crawl USING (node_id)
231
+ INNER JOIN disc.nodes USING (node_id)
232
WHERE
233
next_node_crawl.node_type IN ('Unknown', 'Execution')
- AND last_found > now() - INTERVAL '48 hours'
234
ORDER BY next_node_crawl.next_crawl
235
LIMIT 1024
236
`,
0 commit comments