fix(property): optimize save performance, fix 2dsphere index error and make search indexing non-blocking
deploy-chabokan / deploy (push) Canceled after 0s
deploy-chabokan / deploy (push) Canceled after 0s
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
const propertyService = require('../propertyService')
|
||||
module.exports = (eventEmitter) => {
|
||||
eventEmitter.on('createProperty', async (propertyData) => {
|
||||
await propertyService.indexOneProperty(propertyData._id)
|
||||
try {
|
||||
if (propertyData && propertyData._id) {
|
||||
await propertyService.indexOneProperty(propertyData._id)
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('Error in createProperty event handler:', err.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user