Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Present the entire changelog in its own view (#569)
* Adds functionality to clear a sorted set * Add view for changelog entries * Fix deleting a single lock * Move sidekiq.rb to initializers * Tweak to minimal implementation * Add a worker without lock limit * Mandatory rubocop commit
- Loading branch information
Showing
15 changed files
with
273 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<header class="row"> | ||
<div class="col-sm-5"> | ||
<h3> | ||
<%= t('Changelog Entries') %> | ||
</h3> | ||
</div> | ||
<form action="<%= root_path %>changelogs" class="form form-inline" method="get"> | ||
<%= csrf_tag %> | ||
<input name="filter" class="form-control" type="text" value="<%= @filter %>" /> | ||
<button class="btn btn-default" type="submit"> | ||
<%= t('Filter') %> | ||
</button> | ||
</form> | ||
<% if @changelogs.any? && @total_size > @count.to_i %> | ||
<div class="col-sm-4"> | ||
<%= erb unique_template(:_paging), locals: { url: "#{root_path}changelogs" } %> | ||
</div> | ||
<% end %> | ||
</header> | ||
<% if @changelogs.any? %> | ||
<div class="table_container"> | ||
<form action="<%= root_path %>changelogs/delete_all" method="get"> | ||
<input class="btn btn-danger btn-xs" type="submit" name="delete_all" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" /> | ||
</form> | ||
<br/> | ||
<table class="table table-striped table-bordered table-hover"> | ||
<thead> | ||
<tr> | ||
<th><%= t('Time') %></th> | ||
<th><%= t('Digest') %></th> | ||
<th><%= t('Script') %></th> | ||
<th><%= t('JID') %></th> | ||
<th><%= t('Prev JID') %></th> | ||
<th><%= t('Message') %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @changelogs.each do |changelog| %> | ||
<tr> | ||
<td><%= safe_relative_time(changelog["time"]) %></td> | ||
<td><%= changelog["digest"] %></td> | ||
<td><%= changelog["script"] %></td> | ||
<td><%= changelog["prev_jid"] %></td> | ||
<td><%= changelog["message"] %></th> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<form action="<%= root_path %>changelogs/delete_all" method="get"> | ||
<input class="btn btn-danger btn-xs" type="submit" name="delete_all" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" /> | ||
</form> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class UntilExecutedWorker | ||
include Sidekiq::Worker | ||
|
||
sidekiq_options lock: :until_executed, | ||
lock_info: true, | ||
lock_timeout: 0 | ||
|
||
def perform | ||
logger.info("cowboy") | ||
sleep(1) # hardcore processing | ||
logger.info("beebop") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.