Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ServerOptions {
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
port?: number // If not set will try to use SERVER_PORT or default to: 3000
noHealthChecks?: boolean // If set to true will disable health checks on the RT-CV server
skipSlugCheck?: boolean // If set to true will not check and update the slug on the RT-CV server
skipSlugCheck?: boolean // If set to true will not enforce that the scraper has a slug configured
skipAliveCheck?: boolean // If set to true will skip the check if the scraper is allowed to scrape

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

if (!options.skipSlugCheck) this.setSlug()

if (options.customHandlers) {
try {
this.addCustomHandler(options.customHandlers)
Expand Down Expand Up @@ -917,31 +915,6 @@ export class Server {
return response
}

private async setSlug() {
console.log("Setting slug in rt-cv...")

let slugResponse: {
slug: string
oldSlug: string
overwroteExisting: boolean
}
try {
slugResponse = await this.fetchWithRetry(this.isAppMode ? "/api/private/scraper/set-slug" : "/api/v1/scraper/setSlug", {
method: "PUT",
body: { slug: this.slug },
})
} catch (e) {
console.log("error setting slug,", e)
return
}

if (slugResponse.overwroteExisting) {
console.log(
`Warning: Overwrote existing slug ('${slugResponse.oldSlug}') with '${slugResponse.slug}'`,
)
}
}

private mightGetEnv(k: string): string {
return process.env[k] || ""
}
Expand Down
Loading