diff options
| author | Magnus Ahltorp <map@kth.se> | 2015-02-02 14:37:22 +0100 |
|---|---|---|
| committer | Magnus Ahltorp <map@kth.se> | 2015-02-02 14:37:22 +0100 |
| commit | 48a012e62e24db422c92378f8449d0aa859bc01c (patch) | |
| tree | bfaea06b7940bfa363b43a3eba16f377737a8976 /src/storagedb.erl | |
| parent | d85f454da0685e199378aa1b93c2483c6fa19544 (diff) | |
Only serialize the actual write on storagedb, not the fsync
Diffstat (limited to 'src/storagedb.erl')
| -rw-r--r-- | src/storagedb.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/storagedb.erl b/src/storagedb.erl index 444abc1..9cdf4c1 100644 --- a/src/storagedb.erl +++ b/src/storagedb.erl @@ -36,7 +36,9 @@ fetchnewhashes(Index) -> -spec add(binary()) -> ok. add(LeafHash) -> - call(?MODULE, {add, LeafHash}). + ok = call(?MODULE, {add_nosync, LeafHash}), + ok = index:sync(newentries_path()), + ok. %%%%%%%%%%%%%%%%%%%% %% gen_server callbacks. @@ -63,6 +65,6 @@ newentries_path() -> handle_call(stop, _From, State) -> {stop, normal, stopped, State}; -handle_call({add, LeafHash}, _From, State) -> - ok = index:addlast(newentries_path(), LeafHash), +handle_call({add_nosync, LeafHash}, _From, State) -> + ok = index:addlast_nosync(newentries_path(), LeafHash), {reply, ok, State}. |
