Skip to content

Commit

Permalink
fixed rollback logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dheeraj Yennam committed Oct 5, 2021
1 parent 6b4f361 commit 9b2007e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Have a version of NODE(=>12) installed.
end

## ISSUES:
Transactions/Rollback doesnt work as intended, it overwrites the original hashmap on every call.
Transactions/Rollback doesn't work as intended. Only one instance of transaction can be ran at a time
2 changes: 1 addition & 1 deletion in-mem.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Database {

// Rollback the transaction
rollback() {
if (transactionMap.values()) {
if (transactionMap.size) {
transactionMap.clear();
} else {
console.log("Nothing to Rollback");
Expand Down

0 comments on commit 9b2007e

Please sign in to comment.