mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix(subs): establish lock to prevent race condition
This commit is contained in:
@@ -431,6 +431,8 @@ export default new Schema({
|
||||
|
||||
lastCron: { $type: Date, default: Date.now },
|
||||
_cronSignature: { $type: String, default: 'NOT_RUNNING' }, // Private property used to avoid double cron
|
||||
// Lock property to avoid double subscription. Not strictly private because we query on it
|
||||
_subSignature: { $type: String, default: 'NOT_RUNNING' },
|
||||
|
||||
// {GROUP_ID: Boolean}, represents whether they have unseen chat messages
|
||||
newMessages: {
|
||||
|
||||
Reference in New Issue
Block a user