vitosamson / modlogs

A service for allowing subreddits to publish their moderator logs
https://modlogs.fyi
14 stars 3 forks source link

disable snoowrap proxy feature #7

Closed vitosamson closed 7 years ago

vitosamson commented 7 years ago

r.config({ proxies: false })

this seems to be causing an issue when performing the initial log fetch for a subreddit with many thousands of logs. mem usage spikes to a gig+ during the insertMany(group) here.

it must have something to do with mongo trying to access properties on the logs that are being inserted, but since they're formatted prior to the insertion (and therefore no longer proxy objects), I'm not sure how that would be happening.

this may require changes outside of reddit.ts

example change: return await this.r.getSubreddit(subredditName).getModerationLog(opts).fetchAll() -> return (await this.r.getSubreddit(subredditName).getModerationLog(opts)).fetchAll()