[release] v0.12.0-unstable44
This commit is contained in:
parent
050fe7484b
commit
73196dadf6
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.12.0-unstable43",
|
||||
"version": "0.12.0-unstable44",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
|
|
@ -143,10 +143,11 @@ func flushAllBuffers() {
|
|||
func BufferedDBWrite(collectionName string, object map[string]interface{}) {
|
||||
bufferLock.Lock()
|
||||
writeBuffer[collectionName] = append(writeBuffer[collectionName], object)
|
||||
bufferLock.Unlock()
|
||||
|
||||
if len(writeBuffer[collectionName]) >= bufferCapacity {
|
||||
flushBuffer(collectionName)
|
||||
}
|
||||
bufferLock.Unlock()
|
||||
}
|
||||
|
||||
func WriteToDatabase(collection *mongo.Collection, objects []map[string]interface{}) error {
|
||||
|
|
Loading…
Reference in a new issue