Closed itsjoekent closed 7 years ago
This is likely an order of operations issue. If we're closing a Campaign and we remove the Campaign ID from CAMPAIGNBOT_CAMPAIGNS
while its status is Active -- that Campaign status will never be updated to closed on app start.
One idea to resolve is to change loadCampaigns
to just update the cache for all Campaigns we have documents for.
@deadlybutter Can you update issue description with actual text? The screenshots of Slack rooms won't help surface this issue when searching.
I've pondering using campaigns.findById
every time we need to load a Campaign instead of keeping them in memory on app start -- deprecating the CAMPAIGNBOT_CAMPAIGNS
config variable altogether in favor of a new campaignbot
boolean property on the Campaign model that admins can use to enable/disable CampaignBot campaigns. This would avoid needing to restart the app to turn campaigns on/off... although it would slow things down. We load keywords all in memory too -- which would be another Mongo query to execute if a keyword
parameter is passed in an incoming chatbot request.
+1 to loading from DB instead of memory where possible
Closing this, as the investigation is done. This will be fixed when #775 is resolved.