about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-02-20 22:41:20 +0100
committerGitHub <noreply@github.com>2023-02-20 22:41:20 +0100
commit45087c1092143e95dfcc85b6c9abc5c6c0a0a5c2 (patch)
treee4be53cb0b2e7f876bea6c61d4fe64d7586ae63d /lib/tasks
parent4c68189d2b8b6a9a74fc13862b11bf6c6d523409 (diff)
parentdc0cc5a57d224b4c53bc58dad919b727055bd9a3 (diff)
Merge pull request #2117 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/db.rake14
-rw-r--r--lib/tasks/mastodon.rake6
-rw-r--r--lib/tasks/statistics.rake2
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index ca939fd1f..e8a64b8fb 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -4,16 +4,14 @@ namespace :db do
   namespace :migrate do
     desc 'Setup the db or migrate depending on state of db'
     task setup: :environment do
-      begin
-        if ActiveRecord::Migrator.current_version.zero?
-          Rake::Task['db:migrate'].invoke
-          Rake::Task['db:seed'].invoke
-        end
-      rescue ActiveRecord::NoDatabaseError
-        Rake::Task['db:setup'].invoke
-      else
+      if ActiveRecord::Migrator.current_version.zero?
         Rake::Task['db:migrate'].invoke
+        Rake::Task['db:seed'].invoke
       end
+    rescue ActiveRecord::NoDatabaseError
+      Rake::Task['db:setup'].invoke
+    else
+      Rake::Task['db:migrate'].invoke
     end
   end
 
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index 1184e5273..179a730bc 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -264,7 +264,7 @@ namespace :mastodon do
 
           env['S3_ENDPOINT'] = prompt.ask('Storj DCS endpoint URL:') do |q|
             q.required true
-            q.default "https://gateway.storjshare.io"
+            q.default 'https://gateway.storjshare.io'
             q.modify :strip
           end
 
@@ -286,13 +286,13 @@ namespace :mastodon do
             q.required true
             q.modify :strip
           end
-          
+
           linksharing_access_key = prompt.ask('Storj Linksharing access key (uplink share --register --public --readonly=true --disallow-lists --not-after=none sj://bucket):') do |q|
             q.required true
             q.modify :strip
           end
           env['S3_ALIAS_HOST'] = "link.storjshare.io/raw/#{linksharing_access_key}/#{env['S3_BUCKET']}"
-          
+
         when 'Google Cloud Storage'
           env['S3_ENABLED']             = 'true'
           env['S3_PROTOCOL']            = 'https'
diff --git a/lib/tasks/statistics.rake b/lib/tasks/statistics.rake
index 82f2b5416..440c309ce 100644
--- a/lib/tasks/statistics.rake
+++ b/lib/tasks/statistics.rake
@@ -13,7 +13,7 @@ namespace :mastodon do
       %w(Validators app/validators),
       %w(Workers app/workers),
     ].each do |name, dir|
-      ::STATS_DIRECTORIES << [name, Rails.root.join(dir)]
+      STATS_DIRECTORIES << [name, Rails.root.join(dir)]
     end
   end
 end