summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-25 21:37:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-25 21:37:11 +0100
commit87a3ceb0c1d853ea6d12cd080e6e1e92919874a4 (patch)
treec1d759142365284a0cc0131544356fd8fd70e314
parenta30970eb8b8ddb4c6a22f8d1715ebbad088d87e5 (diff)
remove sleep(1) workaround in checkout-before-checkin code path
The unique constraint on (user id, timestamp) is no longer present
-rwxr-xr-xlib/Travelynx.pm13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 7c89b04..b81ec46 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -536,23 +536,14 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
my $user = $self->get_user_status;
if ( $user->{checked_in} ) {
- # If a user is already checked in, we assume that they forgot to
- # check out and do it for them.
- # XXX this is an ugly workaround for the UNIQUE constraint on
- # (user id, action timestamp): Ensure that checkout and re-checkin
- # work even if the previous checkin was less than a second ago.
- sleep(1);
+ # If a user is already checked in, we assume that they forgot to
+ # check out and do it for them.
$self->checkout( $station, 1 );
-
- # XXX same workaround: We can't checkin immediately after checkout.
- sleep(1);
}
elsif ( $user->{cancelled} ) {
# Same
- sleep(1);
$self->cancelled_to($station);
- sleep(1);
}
my $success = $self->app->action_query->execute(