Ensure unique transaction IDs
Long overdue :)
This commit is contained in:
parent
44d17e6ae0
commit
922f8dc8f6
2 changed files with 6 additions and 4 deletions
|
@ -83,9 +83,8 @@ sub checkout($self, $user) {
|
|||
for $entry, $entry->contras;
|
||||
}
|
||||
|
||||
my $transaction_id = time() - 1300000000;
|
||||
|
||||
RevBank::FileIO::with_lock {
|
||||
my $transaction_id = time() - 1300000000;
|
||||
RevBank::Plugins::call_hooks("checkout", $self, $user, $transaction_id);
|
||||
|
||||
for my $account (reverse sort keys %deltas) {
|
||||
|
@ -96,11 +95,12 @@ sub checkout($self, $user) {
|
|||
}
|
||||
|
||||
RevBank::Plugins::call_hooks("checkout_done", $self, $user, $transaction_id);
|
||||
|
||||
sleep 1; # look busy (and ensure new id for next transaction :))
|
||||
};
|
||||
|
||||
$self->empty;
|
||||
|
||||
sleep 1; # Ensure new timestamp/id for new transaction
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue