sufia-models 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/actors/sufia/generic_file/actor.rb +4 -7
- data/app/jobs/active_fedora_id_based_job.rb +1 -1
- data/app/jobs/active_fedora_pid_based_job.rb +1 -2
- data/app/jobs/audit_job.rb +1 -1
- data/app/jobs/batch_update_job.rb +6 -6
- data/app/jobs/create_derivatives_job.rb +2 -3
- data/app/jobs/import_url_job.rb +8 -5
- data/app/jobs/ingest_local_file_job.rb +1 -1
- data/app/models/batch.rb +15 -21
- data/app/models/checksum_audit_log.rb +0 -1
- data/app/models/concerns/sufia/ability.rb +5 -0
- data/app/models/concerns/sufia/collection_behavior.rb +3 -2
- data/app/models/concerns/sufia/file_stat_utils.rb +19 -21
- data/app/models/concerns/sufia/generic_file/batches.rb +1 -3
- data/app/models/concerns/sufia/generic_file/characterization.rb +11 -16
- data/app/models/concerns/sufia/generic_file/content.rb +0 -1
- data/app/models/concerns/sufia/generic_file/derivatives.rb +2 -2
- data/app/models/concerns/sufia/generic_file/export.rb +50 -59
- data/app/models/concerns/sufia/generic_file/full_text_indexing.rb +15 -18
- data/app/models/concerns/sufia/generic_file/metadata.rb +0 -2
- data/app/models/concerns/sufia/generic_file/mime_types.rb +9 -9
- data/app/models/concerns/sufia/generic_file/permissions.rb +0 -1
- data/app/models/concerns/sufia/generic_file/proxy_deposit.rb +0 -1
- data/app/models/concerns/sufia/generic_file/querying.rb +9 -5
- data/app/models/concerns/sufia/generic_file/trophies.rb +1 -1
- data/app/models/concerns/sufia/generic_file/versions.rb +0 -4
- data/app/models/concerns/sufia/model_methods.rb +0 -1
- data/app/models/concerns/sufia/user.rb +15 -15
- data/app/models/concerns/sufia/user_usage_stats.rb +0 -2
- data/app/models/datastreams/fits_datastream.rb +25 -25
- data/app/models/domain_term.rb +2 -3
- data/app/models/featured_work.rb +3 -5
- data/app/models/file_download_stat.rb +3 -4
- data/app/models/file_usage.rb +10 -11
- data/app/models/file_view_stat.rb +3 -3
- data/app/models/follow.rb +1 -1
- data/app/models/geo_names_resource.rb +3 -3
- data/app/models/group.rb +1 -3
- data/app/models/local_authority.rb +26 -28
- data/app/models/proxy_deposit_request.rb +9 -9
- data/app/models/single_use_link.rb +10 -18
- data/app/models/sufia/download.rb +2 -2
- data/app/models/sufia/pageview.rb +1 -1
- data/app/models/trophy.rb +2 -4
- data/app/services/sufia/analytics.rb +10 -11
- data/app/services/sufia/generic_file_audit_service.rb +11 -12
- data/app/services/sufia/repository_audit_service.rb +1 -1
- data/config/locales/sufia.en.yml +2 -0
- data/lib/generators/sufia/models/abstract_migration_generator.rb +7 -6
- data/lib/generators/sufia/models/install_generator.rb +3 -3
- data/lib/generators/sufia/models/templates/config/arkivo_constraint.rb +1 -1
- data/lib/generators/sufia/models/templates/config/clamav.rb +1 -1
- data/lib/generators/sufia/models/templates/config/redis_config.rb +13 -5
- data/lib/generators/sufia/models/templates/config/resque_admin.rb +2 -2
- data/lib/generators/sufia/models/templates/config/resque_config.rb +1 -1
- data/lib/generators/sufia/models/templates/config/sufia.rb +10 -4
- data/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +1 -1
- data/lib/generators/sufia/models/templates/migrations/create_file_download_stats.rb +1 -1
- data/lib/generators/sufia/models/templates/migrations/create_file_view_stats.rb +1 -1
- data/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +1 -1
- data/lib/generators/sufia/models/update_content_blocks_generator.rb +0 -1
- data/lib/generators/sufia/models/upgrade600_generator.rb +0 -1
- data/lib/generators/sufia/models/user_stats_generator.rb +2 -2
- data/lib/sufia/messages.rb +17 -17
- data/lib/sufia/models.rb +1 -1
- data/lib/sufia/models/active_fedora/redis.rb +1 -4
- data/lib/sufia/models/active_record/redis.rb +2 -3
- data/lib/sufia/models/engine.rb +12 -7
- data/lib/sufia/models/file_content/versions.rb +0 -1
- data/lib/sufia/models/resque.rb +2 -2
- data/lib/sufia/models/stats/user_stat_importer.rb +65 -67
- data/lib/sufia/models/user_local_directory_behavior.rb +9 -13
- data/lib/sufia/models/utils.rb +1 -2
- data/lib/sufia/models/version.rb +1 -1
- data/lib/sufia/permissions.rb +0 -1
- data/lib/sufia/permissions/readable.rb +0 -1
- data/lib/sufia/permissions/writable.rb +20 -23
- data/lib/tasks/sufia-models_tasks.rake +18 -0
- data/sufia-models.gemspec +1 -1
- metadata +5 -5
data/config/locales/sufia.en.yml
CHANGED
@@ -11,7 +11,8 @@ class Sufia::Models::AbstractMigrationGenerator < Rails::Generators::Base
|
|
11
11
|
if @prev_migration_nr
|
12
12
|
@prev_migration_nr += 1
|
13
13
|
else
|
14
|
-
|
14
|
+
last_migration = Dir[File.join(path, '*.rb')].sort.last
|
15
|
+
if last_migration
|
15
16
|
@prev_migration_nr = last_migration.sub(File.join(path, '/'), '').to_i + 1
|
16
17
|
else
|
17
18
|
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
@@ -22,9 +23,9 @@ class Sufia::Models::AbstractMigrationGenerator < Rails::Generators::Base
|
|
22
23
|
|
23
24
|
protected
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
def better_migration_template(file)
|
27
|
+
migration_template "migrations/#{file}", "db/migrate/#{file}"
|
28
|
+
rescue Rails::Generators::Error => e
|
29
|
+
say_status("error", e.message, :red)
|
30
|
+
end
|
30
31
|
end
|
@@ -2,7 +2,7 @@ require_relative 'abstract_migration_generator'
|
|
2
2
|
|
3
3
|
class Sufia::Models::InstallGenerator < Sufia::Models::AbstractMigrationGenerator
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
argument
|
5
|
+
argument :model_name, type: :string, default: "user"
|
6
6
|
desc """
|
7
7
|
This generator makes the following changes to your application:
|
8
8
|
1. Creates several database migrations if they do not exist in /db/migrate
|
@@ -46,7 +46,7 @@ This generator makes the following changes to your application:
|
|
46
46
|
# Add behaviors to the user model
|
47
47
|
def inject_sufia_user_behavior
|
48
48
|
file_path = "app/models/#{model_name.underscore}.rb"
|
49
|
-
if File.
|
49
|
+
if File.exist?(file_path)
|
50
50
|
inject_into_file file_path, after: /include Hydra\:\:User.*$/ do
|
51
51
|
"# Connects this user object to Sufia behaviors. " +
|
52
52
|
"\n include Sufia::User\n"
|
@@ -58,7 +58,7 @@ This generator makes the following changes to your application:
|
|
58
58
|
|
59
59
|
def create_configuration_files
|
60
60
|
append_file 'config/initializers/mime_types.rb',
|
61
|
-
|
61
|
+
"\nMime::Type.register 'application/x-endnote-refer', :endnote", verbose: false
|
62
62
|
copy_file 'config/sufia.rb', 'config/initializers/sufia.rb'
|
63
63
|
copy_file 'config/redis.yml', 'config/redis.yml'
|
64
64
|
copy_file 'config/resque-pool.yml', 'config/resque-pool.yml'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Sufia
|
2
2
|
class ArkivoConstraint
|
3
|
-
def self.matches?(
|
3
|
+
def self.matches?(_request)
|
4
4
|
# Add your own logic here to authorize trusted connections to
|
5
5
|
# the API e.g., if your installation of Arkivo runs on a host
|
6
6
|
# with the 10.0.0.3 IP address, you could use:
|
@@ -1 +1 @@
|
|
1
|
-
ClamAV.instance.loaddb
|
1
|
+
ClamAV.instance.loaddb if defined? ClamAV
|
@@ -4,24 +4,32 @@ if defined?(PhusionPassenger)
|
|
4
4
|
if forked
|
5
5
|
# Re-establish redis connection
|
6
6
|
require 'redis'
|
7
|
-
config = YAML
|
7
|
+
config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
8
8
|
|
9
9
|
# The important two lines
|
10
10
|
$redis.client.disconnect if $redis
|
11
|
-
$redis =
|
11
|
+
$redis = begin
|
12
|
+
Redis.new(host: config[:host], port: config[:port], thread_safe: true)
|
13
|
+
rescue
|
14
|
+
nil
|
15
|
+
end
|
12
16
|
Resque.redis = $redis
|
13
17
|
Resque.redis.client.reconnect if Resque.redis
|
14
18
|
Resque.redis.namespace = "#{Sufia.config.redis_namespace}:#{Rails.env}"
|
15
19
|
end
|
16
20
|
end
|
17
21
|
else
|
18
|
-
config = YAML
|
19
|
-
$redis =
|
22
|
+
config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
23
|
+
$redis = begin
|
24
|
+
Redis.new(host: config[:host], port: config[:port], thread_safe: true)
|
25
|
+
rescue
|
26
|
+
nil
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
22
30
|
# Code borrowed from Obie's Redis patterns talk at RailsConf'12
|
23
31
|
Nest.class_eval do
|
24
|
-
def initialize(key, redis
|
32
|
+
def initialize(key, redis = $redis)
|
25
33
|
super(key.to_param)
|
26
34
|
@redis = redis
|
27
35
|
end
|
@@ -3,8 +3,8 @@ module Sufia
|
|
3
3
|
def self.matches?(request)
|
4
4
|
current_user = request.env['warden'].user
|
5
5
|
return false if current_user.blank?
|
6
|
-
# TODO code a group here that makes sense
|
7
|
-
#current_user.groups.include? 'umg/up.dlt.scholarsphere-admin'
|
6
|
+
# TODO: code a group here that makes sense
|
7
|
+
# current_user.groups.include? 'umg/up.dlt.scholarsphere-admin'
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
config = YAML
|
1
|
+
config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
|
2
2
|
Resque.redis = Redis.new(host: config[:host], port: config[:port], thread_safe: true)
|
3
3
|
|
4
4
|
Resque.inline = Rails.env.test?
|
@@ -42,7 +42,7 @@ Sufia.config do |config|
|
|
42
42
|
"Research Paper" => "Research Paper",
|
43
43
|
"Software or Program Code" => "Software or Program Code",
|
44
44
|
"Video" => "Video",
|
45
|
-
"Other" => "Other"
|
45
|
+
"Other" => "Other"
|
46
46
|
}
|
47
47
|
|
48
48
|
config.resource_types_to_schema = {
|
@@ -65,11 +65,11 @@ Sufia.config do |config|
|
|
65
65
|
"Research Paper" => "http://schema.org/ScholarlyArticle",
|
66
66
|
"Software or Program Code" => "http://schema.org/Code",
|
67
67
|
"Video" => "http://schema.org/VideoObject",
|
68
|
-
"Other" => "http://schema.org/CreativeWork"
|
68
|
+
"Other" => "http://schema.org/CreativeWork"
|
69
69
|
}
|
70
70
|
|
71
71
|
config.permission_levels = {
|
72
|
-
"Choose Access"=>"none",
|
72
|
+
"Choose Access" => "none",
|
73
73
|
"View/Download" => "read",
|
74
74
|
"Edit" => "edit"
|
75
75
|
}
|
@@ -107,6 +107,13 @@ Sufia.config do |config|
|
|
107
107
|
# Specify a different template for your repository's NOID IDs
|
108
108
|
# config.noid_template = ".reeddeeddk"
|
109
109
|
|
110
|
+
# Store identifier minter's state in a file for later replayability
|
111
|
+
# config.minter_statefile = '/tmp/minter-state'
|
112
|
+
|
113
|
+
# Process for translating Fedora URIs to identifiers and vice versa
|
114
|
+
# config.translate_uri_to_id = ActiveFedora::Noid.config.translate_uri_to_id
|
115
|
+
# config.translate_id_to_uri = ActiveFedora::Noid.config.translate_id_to_uri
|
116
|
+
|
110
117
|
# Specify the prefix for Redis keys:
|
111
118
|
# config.redis_namespace = "sufia"
|
112
119
|
|
@@ -135,7 +142,6 @@ Sufia.config do |config|
|
|
135
142
|
rescue Errno::ENOENT
|
136
143
|
config.browse_everything = nil
|
137
144
|
end
|
138
|
-
|
139
145
|
end
|
140
146
|
|
141
147
|
Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
|
@@ -9,7 +9,7 @@ class CreateChecksumAuditLogs < ActiveRecord::Migration
|
|
9
9
|
t.string :actual_result
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
|
-
add_index :checksum_audit_logs, [:pid, :dsid], name: 'by_pid_and_dsid', order: {created_at: "DESC" }
|
12
|
+
add_index :checksum_audit_logs, [:pid, :dsid], name: 'by_pid_and_dsid', order: { created_at: "DESC" }
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.down
|
@@ -20,7 +20,7 @@ class CreateLocalAuthorities < ActiveRecord::Migration
|
|
20
20
|
t.integer :local_authority_id, foreign_key: true
|
21
21
|
end
|
22
22
|
|
23
|
-
create_table :subject_local_authority_entries, force: true
|
23
|
+
create_table :subject_local_authority_entries, force: true do |t|
|
24
24
|
t.string :label
|
25
25
|
t.string :lowerLabel
|
26
26
|
t.string :url
|
@@ -2,7 +2,7 @@ require_relative 'abstract_migration_generator'
|
|
2
2
|
|
3
3
|
class Sufia::Models::UserStatsGenerator < Sufia::Models::AbstractMigrationGenerator
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
argument :model_name, type: :string
|
5
|
+
argument :model_name, type: :string, default: "user"
|
6
6
|
|
7
7
|
desc """
|
8
8
|
This generator adds usage stats methods to the user model in your application:
|
@@ -20,7 +20,7 @@ This generator adds usage stats methods to the user model in your application:
|
|
20
20
|
def add_stats_mixin_to_user_model
|
21
21
|
file_path = "app/models/#{model_name.underscore}.rb"
|
22
22
|
|
23
|
-
if File.
|
23
|
+
if File.exist?(file_path)
|
24
24
|
inject_into_file file_path, after: /include Sufia\:\:User.*$/ do
|
25
25
|
"\n include Sufia::UserUsageStats"
|
26
26
|
end
|
data/lib/sufia/messages.rb
CHANGED
@@ -15,52 +15,52 @@ module Sufia
|
|
15
15
|
I18n.t("sufia.messages.failure.subject")
|
16
16
|
end
|
17
17
|
|
18
|
-
def single_success
|
19
|
-
content_tag :span, id: "ss-"+id do
|
18
|
+
def single_success(id, file)
|
19
|
+
content_tag :span, id: "ss-" + id do
|
20
20
|
[link_to_file(file), I18n.t("sufia.messages.success.single")].join(" ").html_safe
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def multiple_success
|
25
|
-
content_tag :span, id: "ss-"+id do
|
24
|
+
def multiple_success(id, files)
|
25
|
+
content_tag :span, id: "ss-" + id do
|
26
26
|
[success_link(files), I18n.t("sufia.messages.success.multiple.tag")].join(" ").html_safe
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def single_failure
|
31
|
-
content_tag :span, id: "ss-"+id do
|
30
|
+
def single_failure(id, file)
|
31
|
+
content_tag :span, id: "ss-" + id do
|
32
32
|
[link_to_file(file), I18n.t("sufia.messages.failure.single")].join(" ").html_safe
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def multiple_failure
|
37
|
-
content_tag :span, id: "ss-"+id do
|
36
|
+
def multiple_failure(id, files)
|
37
|
+
content_tag :span, id: "ss-" + id do
|
38
38
|
[failure_link(files), I18n.t("sufia.messages.failure.multiple.tag")].join(" ").html_safe
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
# Double-quotes are replaced with single ones so this list can be included in a data block. Ex:
|
43
43
|
# <a href="#" data-content="<a href='#'>embedded link</a>" rel="popover">Click me</a>
|
44
|
-
def file_list
|
45
|
-
files.map { |gf| link_to_file(gf) }.join(', ').
|
44
|
+
def file_list(files)
|
45
|
+
files.map { |gf| link_to_file(gf) }.join(', ').tr("\"", "'")
|
46
46
|
end
|
47
47
|
|
48
|
-
def link_to_file
|
48
|
+
def link_to_file(file)
|
49
49
|
link_to(file.to_s, Sufia::Engine.routes.url_helpers.generic_file_path(file))
|
50
50
|
end
|
51
51
|
|
52
52
|
private
|
53
53
|
|
54
|
-
def success_link
|
54
|
+
def success_link(files)
|
55
55
|
link_to I18n.t("sufia.messages.success.multiple.link"), "#",
|
56
|
-
|
57
|
-
|
56
|
+
rel: "popover",
|
57
|
+
data: { content: file_list(files).html_safe, title: I18n.t("sufia.messages.success.title") }
|
58
58
|
end
|
59
59
|
|
60
|
-
def failure_link
|
60
|
+
def failure_link(files)
|
61
61
|
link_to I18n.t("sufia.messages.failure.multiple.link"), "#",
|
62
|
-
|
63
|
-
|
62
|
+
rel: "popover",
|
63
|
+
data: { content: file_list(files).html_safe, title: I18n.t("sufia.messages.failure.title") }
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/lib/sufia/models.rb
CHANGED
@@ -12,7 +12,7 @@ module ActiveFedora
|
|
12
12
|
nil
|
13
13
|
end
|
14
14
|
|
15
|
-
def events(size
|
15
|
+
def events(size = -1)
|
16
16
|
stream[:event].lrange(0, size).map do |event_id|
|
17
17
|
{
|
18
18
|
action: $redis.hget("events:#{event_id}", "action"),
|
@@ -38,6 +38,3 @@ module ActiveFedora
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
42
|
-
|
43
|
-
|
@@ -11,7 +11,7 @@ ActiveRecord::Base.class_eval do
|
|
11
11
|
nil
|
12
12
|
end
|
13
13
|
|
14
|
-
def events(size
|
14
|
+
def events(size = -1)
|
15
15
|
stream[:event].lrange(0, size).map do |event_id|
|
16
16
|
{
|
17
17
|
action: $redis.hget("events:#{event_id}", "action"),
|
@@ -22,7 +22,7 @@ ActiveRecord::Base.class_eval do
|
|
22
22
|
[]
|
23
23
|
end
|
24
24
|
|
25
|
-
def profile_events(size
|
25
|
+
def profile_events(size = -1)
|
26
26
|
stream[:event][:profile].lrange(0, size).map do |event_id|
|
27
27
|
{
|
28
28
|
action: $redis.hget("events:#{event_id}", "action"),
|
@@ -53,4 +53,3 @@ ActiveRecord::Base.class_eval do
|
|
53
53
|
nil
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
data/lib/sufia/models/engine.rb
CHANGED
@@ -5,11 +5,12 @@ module Sufia
|
|
5
5
|
|
6
6
|
yield @@config if block
|
7
7
|
|
8
|
-
|
8
|
+
@@config
|
9
9
|
end
|
10
10
|
|
11
11
|
class Engine < ::Rails::Engine
|
12
12
|
require 'sufia/models/resque'
|
13
|
+
require 'active_fedora/noid'
|
13
14
|
|
14
15
|
# Set some configuration defaults
|
15
16
|
config.persistent_hostpath = "http://localhost/files/"
|
@@ -17,9 +18,6 @@ module Sufia
|
|
17
18
|
config.ffmpeg_path = 'ffmpeg'
|
18
19
|
config.fits_message_length = 5
|
19
20
|
config.temp_file_base = nil
|
20
|
-
config.enable_noids = true
|
21
|
-
config.noid_template = '.reeddeeddk'
|
22
|
-
config.minter_statefile = '/tmp/minter-state'
|
23
21
|
config.redis_namespace = "sufia"
|
24
22
|
config.fits_path = "fits.sh"
|
25
23
|
config.enable_contact_form_delivery = false
|
@@ -28,10 +26,17 @@ module Sufia
|
|
28
26
|
config.analytics = false
|
29
27
|
config.queue = Sufia::Resque::Queue
|
30
28
|
config.max_notifications_for_dashboard = 5
|
31
|
-
config.activity_to_show_default_seconds_since_now = 24*60*60
|
29
|
+
config.activity_to_show_default_seconds_since_now = 24 * 60 * 60
|
32
30
|
config.arkivo_api = false
|
33
31
|
config.retry_unless_sleep = 0.0
|
34
32
|
|
33
|
+
# Noid identifiers
|
34
|
+
config.enable_noids = true
|
35
|
+
config.noid_template = '.reeddeeddk'
|
36
|
+
config.minter_statefile = '/tmp/minter-state'
|
37
|
+
config.translate_uri_to_id = ActiveFedora::Noid.config.translate_uri_to_id
|
38
|
+
config.translate_id_to_uri = ActiveFedora::Noid.config.translate_id_to_uri
|
39
|
+
|
35
40
|
# Defaulting analytic start date to whenever the file was uploaded by leaving it blank
|
36
41
|
config.analytic_start_date = nil
|
37
42
|
|
@@ -68,8 +73,8 @@ module Sufia
|
|
68
73
|
Hydra::Derivatives.fits_path = c.fits_path
|
69
74
|
Hydra::Derivatives.enable_ffmpeg = c.enable_ffmpeg
|
70
75
|
|
71
|
-
ActiveFedora::Base.translate_uri_to_id =
|
72
|
-
ActiveFedora::Base.translate_id_to_uri =
|
76
|
+
ActiveFedora::Base.translate_uri_to_id = c.translate_uri_to_id
|
77
|
+
ActiveFedora::Base.translate_id_to_uri = c.translate_id_to_uri
|
73
78
|
ActiveFedora::Noid.config.template = c.noid_template
|
74
79
|
ActiveFedora::Noid.config.statefile = c.minter_statefile
|
75
80
|
end
|
data/lib/sufia/models/resque.rb
CHANGED
@@ -18,9 +18,9 @@ module Sufia
|
|
18
18
|
ActiveFedora::Base.logger.error "Redis is down!"
|
19
19
|
rescue Redis::TimeoutError => error
|
20
20
|
ActiveFedora::Base.logger.warn "Redis Timed out. Trying again! #{job.inspect}"
|
21
|
-
push_tries+=1
|
21
|
+
push_tries += 1
|
22
22
|
# fail for good if the tries is greater than 3
|
23
|
-
raise error if push_tries >=3
|
23
|
+
raise error if push_tries >= 3
|
24
24
|
sleep 0.01
|
25
25
|
retry
|
26
26
|
end
|