Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAM-3334-mothsocial-admin-for-a-rebuild-endpoint #222

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ gem 'webpacker', '~> 5.4'
gem 'webpush', github: 'ClearlyClaire/webpush', ref: 'f14a4d52e201128b1b00245d11b6de80d6cfdcd9'
gem 'webauthn', '~> 3.0'

gem 'json-ld'
gem 'json-ld', '~> 3.3', '>= 3.3.1'
gem 'json-ld-preloaded', '~> 3.2'
gem 'rdf-normalize', '~> 0.5'

Expand Down
14 changes: 8 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ GEM
net-http-persistent (~> 4.0)
nokogiri (~> 1, >= 1.10.8)
base64 (0.1.1)
bcp47_spec (0.2.1)
bcrypt (3.1.18)
bcrypt_pbkdf (1.1.0)
better_errors (2.10.1)
Expand Down Expand Up @@ -402,19 +403,19 @@ GEM
ipaddress (0.8.3)
jmespath (1.6.2)
json (2.6.3)
json-canonicalization (0.3.2)
json-canonicalization (1.0.0)
json-jwt (1.15.3)
activesupport (>= 4.2)
aes_key_wrap
bindata
httpclient
json-ld (3.2.5)
json-ld (3.3.1)
htmlentities (~> 4.3)
json-canonicalization (~> 0.3, >= 0.3.2)
json-canonicalization (~> 1.0)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.15)
rack (>= 2.2, < 4)
rdf (~> 3.2, >= 3.2.10)
rdf (~> 3.3)
json-ld-preloaded (3.2.2)
json-ld (~> 3.2)
rdf (~> 3.2)
Expand Down Expand Up @@ -625,7 +626,8 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rdf (3.2.11)
rdf (3.3.1)
bcp47_spec (~> 0.2)
link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.6.1)
rdf (~> 3.2)
Expand Down Expand Up @@ -905,7 +907,7 @@ DEPENDENCIES
httplog (~> 1.6.2)
i18n-tasks (~> 1.0)
idn-ruby
json-ld
json-ld (~> 3.3, >= 3.3.1)
json-ld-preloaded (~> 3.2)
json-schema (~> 4.0)
jwt
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/api/v3/admin/for_you_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class Api::V3::Admin::ForYouController < Api::BaseController
before_action :require_mammoth!

# Ability to Trigger a rebuild from
# Feature or Account Relay
def update
user_account = @decoded['sub']
UpdateForYouWorker.set(queue: 'mammoth_critial').perform_async({ acct: user_account, rebuild: true })
end
end
19 changes: 15 additions & 4 deletions config/appsignal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ default:
working_directory_path: '/tmp/appsignal'

# Actions that should not be monitored by AppSignal
# ignore_actions:
# - ApplicationController#isup
ignore_actions:
- 'LinkCrawlWorker#perform'
- 'ActivityPub::DeliveryWorker#perform'
- 'VerifyAccountLinksWorker#perform'
- 'ActivityPub::SynchronizeFeaturedCollectionWorker#perform'
- 'ActivityPub::FetchRepliesWorker#perform'
- 'ActivityPub::ProcessingWorker#perform'
- 'UpdateStatusStatWorker#perform'
- 'FeedInsertWorker#perform'
- 'ChannelFeedWorker#perform'
- 'ThreadResolveWorker#perform'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cutting down on the noise in AppSignal. These are mostly Mastodon specific errors

# Errors that should not be recorded by AppSignal
# For more information see our docs:
# https://docs.appsignal.com/ruby/configuration/ignore-errors.html
# ignore_errors:
# - Exception
ignore_errors:
- HTTP::TimeoutError
- ActiveRecord::NotNullViolation
- OpenSSL::SSL::SSLError
# - NoMemoryError
# - ScriptError
# - LoadError
Expand Down
4 changes: 4 additions & 0 deletions config/routes/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@
end
end

namespace :admin do
resource :for_you, only: [:update], controller: 'for_you'
end

namespace :timelines do
resources :channels, only: :show, controller: :channels
resource :for_you, only: [:show], controller: 'for_you' do
Expand Down