Skip to content

Commit 947ea7a

Browse files
committed
remove setSlug startup call; slug now set via RT-CV dashboard
1 parent 5420dc3 commit 947ea7a

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

lib/server.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface ServerOptions {
2626
f2fAlternativeApp?: string | false // If not set will try to use F2F_ALTERNATIVE_APP env variable (same format), if set to false will disable alternative app
2727
port?: number // If not set will try to use SERVER_PORT or default to: 3000
2828
noHealthChecks?: boolean // If set to true will disable health checks on the RT-CV server
29-
skipSlugCheck?: boolean // If set to true will not check and update the slug on the RT-CV server
29+
skipSlugCheck?: boolean // If set to true will not enforce that the scraper has a slug configured
3030
skipAliveCheck?: boolean // If set to true will skip the check if the scraper is allowed to scrape
3131

3232
customHandlers?: CustomHandler[] // If set will add external handlers to the server
@@ -205,8 +205,6 @@ export class Server {
205205
})
206206
}
207207

208-
if (!options.skipSlugCheck) this.setSlug()
209-
210208
if (options.customHandlers) {
211209
try {
212210
this.addCustomHandler(options.customHandlers)
@@ -917,31 +915,6 @@ export class Server {
917915
return response
918916
}
919917

920-
private async setSlug() {
921-
console.log("Setting slug in rt-cv...")
922-
923-
let slugResponse: {
924-
slug: string
925-
oldSlug: string
926-
overwroteExisting: boolean
927-
}
928-
try {
929-
slugResponse = await this.fetchWithRetry(this.isAppMode ? "/api/private/scraper/set-slug" : "/api/v1/scraper/setSlug", {
930-
method: "PUT",
931-
body: { slug: this.slug },
932-
})
933-
} catch (e) {
934-
console.log("error setting slug,", e)
935-
return
936-
}
937-
938-
if (slugResponse.overwroteExisting) {
939-
console.log(
940-
`Warning: Overwrote existing slug ('${slugResponse.oldSlug}') with '${slugResponse.slug}'`,
941-
)
942-
}
943-
}
944-
945918
private mightGetEnv(k: string): string {
946919
return process.env[k] || ""
947920
}

0 commit comments

Comments
 (0)