docs add more docs to app/{jobs,logical}.

These were missed in the last commit.
This commit is contained in:
evazion
2021-06-27 18:12:58 -05:00
parent fef5f238a5
commit ad4c75eb1a
16 changed files with 36 additions and 11 deletions

View File

@@ -73,7 +73,7 @@ Each controller action above corresponds to an URL:
| BansController#update | PUT https://danbooru.donmai.us/bans/1234 | PUT /bans/:id | | |
| BansController#destroy | DELETE https://danbooru.donmai.us/bans/1234 | DELETE /bans/:id | | |
These routes are defined in [config/routes.rb](../config/routes.rb).
These routes are defined in [config/routes.rb](../../config/routes.rb).
# Authorization

View File

@@ -1,3 +1,7 @@
# A job that exports a database table to Google Cloud Storage and to Google
# BigQuery. Spawned daily by {DanbooruMaintenance}.
#
# @see BigqueryExportService
class BigqueryExportJob < ApplicationJob
retry_on Exception, attempts: 0

View File

@@ -1,3 +1,5 @@
# A job that sends notifications about new forum posts to Discord. Spawned by
# the {ForumPost} class when a new forum post is created.
class DiscordNotificationJob < ApplicationJob
retry_on Exception, attempts: 0

View File

@@ -1,3 +1,5 @@
# A job that adds a post to IQDB when a new post is uploaded, or when a post is
# regenerated. Spawned by the {Post} class.
class IqdbAddPostJob < ApplicationJob
def perform(post)
IqdbClient.new.add_post(post)

View File

@@ -1,3 +1,5 @@
# A job that removes a post from IQDB when it is deleted. Spawned by the {Post}
# class.
class IqdbRemovePostJob < ApplicationJob
def perform(post_id)
IqdbClient.new.remove(post_id)

View File

@@ -1,3 +1,5 @@
# A job that updates a user's saved searches when they do a search for
# `search:all` or `search:<label>`.
class PopulateSavedSearchJob < ApplicationJob
queue_as :default

View File

@@ -1,3 +1,6 @@
# A job that processes a single tag alias or implication when a bulk update
# request is approved. One job per alias or implication is spawned. Jobs are
# processed sequentially in the `bulk_update` queue.
class ProcessTagRelationshipJob < ApplicationJob
queue_as :bulk_update
retry_on Exception, attempts: 0

View File

@@ -1,5 +1,5 @@
# A job that performs a mass update or tag nuke operation in a bulk update
# request.
# request. Jobs in the `bulk_update` queue are processed sequentially.
class TagBatchChangeJob < ApplicationJob
queue_as :bulk_update

View File

@@ -1,4 +1,4 @@
# A job that tries to resume a preprocessed image upload.
# A job that tries to resume a preprocessed image upload job.
class UploadServiceDelayedStartJob < ApplicationJob
queue_as :default
queue_with_priority(-1)

View File

@@ -1,3 +1,6 @@
# A concern that handles @mentions in comments and forum posts. Sends a DMail
# to mentioned users when a comment or forum post is created or edited to add
# new mentions.
module Mentionable
extend ActiveSupport::Concern

View File

@@ -1,6 +1,6 @@
# A HTTP::Feature that automatically follows HTTP redirects.
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
#
# @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
module Danbooru
class Http
class Redirector < HTTP::Feature

View File

@@ -1,3 +1,4 @@
# A StorageManager that stores files on the local filesystem.
class StorageManager::Local < StorageManager
DEFAULT_PERMISSIONS = 0o644

View File

@@ -1,3 +1,5 @@
# A null StorageManager that doesn't store files at all. Used for testing or
# disabling backups.
class StorageManager::Null < StorageManager
def initialize(base_url: "/", base_dir: "/")
super

View File

@@ -1,3 +1,6 @@
# The base class for emails sent by Danbooru.
#
# @see https://guides.rubyonrails.org/action_mailer_basics.html
class ApplicationMailer < ActionMailer::Base
default from: "#{Danbooru.config.canonical_app_name} <#{Danbooru.config.contact_email}>", content_type: "text/html"
end