Users get deleted every time server gets restarted.
Expected Behavior
The users should be saved in the database and be loaded in the bot instance when it is started.
Current Behavior
When the bot is instantiated from the server, all the models are removed from the database and get imported again at a later stage. The User model is not being imported again apparently, because the ss_users collection is empty
Possible Solution
I noticed that if we remove User from the following array, the users remain in the collection in mongo with no obvious side effect.
The other items in this array are getting imported from the data.json file, but users are not being imported from anywhere, so they should not be removed, they should be persistent
Users get deleted every time server gets restarted.
Expected Behavior
The users should be saved in the database and be loaded in the bot instance when it is started.
Current Behavior
When the bot is instantiated from the server, all the models are removed from the database and get imported again at a later stage. The User model is not being imported again apparently, because the ss_users collection is empty
Possible Solution
I noticed that if we remove User from the following array, the users remain in the collection in mongo with no obvious side effect.
The other items in this array are getting imported from the
data.json
file, but users are not being imported from anywhere, so they should not be removed, they should be persistentIn
lib/bot/db/import.js
, line184
:to this:
Your Environment