fix: increased body size limit, added config option (#3011)

This commit is contained in:
Wyatt Johnson
2020-07-09 22:02:01 +00:00
committed by GitHub
parent d848fc193e
commit 00e074d49d
15 changed files with 152 additions and 69 deletions
+1 -4
View File
@@ -210,12 +210,9 @@ export default (ctx: GraphContext) => ({
}).then(primeStoriesFromConnection(ctx)),
debugScrapeMetadata: new DataLoader(
createManyBatchLoadFn((url: string) =>
// This typecast is needed because the custom `ms` format does not return
// the desired `number` type even though that's the only type it can
// output.
scraper.scrape({
url,
timeout: (ctx.config.get("scrape_timeout") as unknown) as number,
timeout: ctx.config.get("scrape_timeout"),
size: ctx.config.get("scrape_max_response_size"),
customUserAgent: ctx.tenant.stories.scraping.customUserAgent,
proxyURL: ctx.tenant.stories.scraping.proxyURL,
@@ -18,11 +18,9 @@ export const LiveConfiguration: GQLLiveConfigurationTypeResolver<LiveConfigurati
return false;
}
// This typecast is needed because the custom `ms` format does not return the
// desired `number` type even though that's the only type it can output.
const disableLiveUpdatesTimeout = (ctx.config.get(
const disableLiveUpdatesTimeout = ctx.config.get(
"disable_live_updates_timeout"
) as unknown) as number;
);
if (disableLiveUpdatesTimeout > 0) {
// If one of these is available, use it to determine the time since the
// last comment.
@@ -259,11 +259,7 @@ export function createSubscriptionServer(
schema: GraphQLSchema,
options: Options
) {
// This typecast is needed because the custom `ms` format does not return the
// desired `number` type even though that's the only type it can output.
const keepAlive = (options.config.get(
"websocket_keep_alive_timeout"
) as unknown) as number;
const keepAlive = options.config.get("websocket_keep_alive_timeout");
return SubscriptionServer.create(
{