( webScraperOptions: ScrapeJobData, jobId: string, priority: number = 0, listenable: boolean = false, )
| 151 | } |
| 152 | |
| 153 | export async function _addScrapeJobToBullMQ( |
| 154 | webScraperOptions: ScrapeJobData, |
| 155 | jobId: string, |
| 156 | priority: number = 0, |
| 157 | listenable: boolean = false, |
| 158 | ): Promise<NuQJob<ScrapeJobData>> { |
| 159 | // direct adds bypass the gates; on the FDB backend that's a slotless enqueue |
| 160 | if ((await resolveJobBackend(webScraperOptions)) === "fdb") { |
| 161 | if (webScraperOptions.mode === "single_urls") { |
| 162 | abTestJob(webScraperOptions); |
| 163 | } |
| 164 | const { jobs } = await fdbEnqueueScrapeJobs( |
| 165 | [ |
| 166 | { |
| 167 | jobId, |
| 168 | data: webScraperOptions, |
| 169 | priority, |
| 170 | listenable, |
| 171 | backlogTimeoutMs: backlogTimeoutMs(webScraperOptions), |
| 172 | }, |
| 173 | ], |
| 174 | webScraperOptions.team_id, |
| 175 | { bypassGate: true }, |
| 176 | ); |
| 177 | return jobs[0]; |
| 178 | } |
| 179 | |
| 180 | return _addScrapeJobToBullMQPg( |
| 181 | webScraperOptions, |
| 182 | jobId, |
| 183 | priority, |
| 184 | listenable, |
| 185 | ); |
| 186 | } |
| 187 | |
| 188 | async function _addScrapeJobToBullMQPg( |
| 189 | webScraperOptions: ScrapeJobData, |
no test coverage detected
searching dependent graphs…