Skip to content

Commit

Permalink
fix #59, require lock before generate a mq store
Browse files Browse the repository at this point in the history
  • Loading branch information
继盛 committed Jul 29, 2016
1 parent 8ec66dd commit db3b424
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cola/core/mq/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ def put_one(self, obj, force=False, commit=True):
if self.deduper.exist(prop):
return
if len(self.legal_files) == 0:
self._generate_file()
with self.lock:
self._generate_file()

obj_str = self._stringfy(obj)
# If no file has enough space
Expand Down

0 comments on commit db3b424

Please sign in to comment.