Skip to content

Commit

Permalink
Expose the Lock ID on the locks page
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartskelton committed Mar 13, 2024
1 parent 0bf0031 commit a63343c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Minion/Backend/Pg.pm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sub list_locks {
my ($self, $offset, $limit, $options) = @_;

my $locks = $self->pg->db->query(
'SELECT name, EXTRACT(EPOCH FROM expires) AS expires, COUNT(*) OVER() AS total FROM minion_locks
'SELECT id, name, EXTRACT(EPOCH FROM expires) AS expires, COUNT(*) OVER() AS total FROM minion_locks
WHERE expires > NOW() AND (name = ANY ($1) OR $1 IS NULL)
ORDER BY id DESC LIMIT $2 OFFSET $3', $options->{names}, $limit, $offset
)->hashes->to_array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<thead>
<tr>
<th><input class="checkall" data-check="name" type="checkbox"></th>
<th>Lock ID</th>
<th>Name</th>
<th>Expires</th>
</tr>
Expand All @@ -37,6 +38,9 @@
<td>
<input type="checkbox" name="name" value="<%= $lock->{name} %>">
</td>
<td>
<%= $lock->{id} %>
</td>
<td>
<a href="<%= url_for->query({name => $lock->{name}}) %>">
<%= $lock->{name} %>
Expand Down

0 comments on commit a63343c

Please sign in to comment.