set Log in inherithed macro for BaseJob subclasses

This commit is contained in:
Fijxu 2025-08-23 14:09:47 -04:00
parent 882bb98e01
commit d0cd940893
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
7 changed files with 2 additions and 12 deletions

View File

@ -6,6 +6,8 @@ abstract class Invidious::Jobs::BaseJob
# and to create the associated instance property. # and to create the associated instance property.
# #
macro inherited macro inherited
Log = ::Log.for(self)
macro finished macro finished
# This config structure can be expanded as required. # This config structure can be expanded as required.
struct Config struct Config

View File

@ -1,6 +1,4 @@
class Invidious::Jobs::ClearExpiredItemsJob < Invidious::Jobs::BaseJob class Invidious::Jobs::ClearExpiredItemsJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
# Remove items (videos, nonces, etc..) whose cache is outdated every hour. # Remove items (videos, nonces, etc..) whose cache is outdated every hour.
# Removes the need for a cron job. # Removes the need for a cron job.
def begin def begin

View File

@ -1,6 +1,4 @@
class Invidious::Jobs::InstanceListRefreshJob < Invidious::Jobs::BaseJob class Invidious::Jobs::InstanceListRefreshJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
# We update the internals of a constant as so it can be accessed from anywhere # We update the internals of a constant as so it can be accessed from anywhere
# within the codebase # within the codebase
# #

View File

@ -22,8 +22,6 @@ struct VideoNotification
end end
class Invidious::Jobs::NotificationJob < Invidious::Jobs::BaseJob class Invidious::Jobs::NotificationJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
private getter notification_channel : ::Channel(VideoNotification) private getter notification_channel : ::Channel(VideoNotification)
private getter connection_channel : ::Channel({Bool, ::Channel(PQ::Notification)}) private getter connection_channel : ::Channel({Bool, ::Channel(PQ::Notification)})
private getter pg_url : URI private getter pg_url : URI

View File

@ -1,6 +1,4 @@
class Invidious::Jobs::RefreshChannelsJob < Invidious::Jobs::BaseJob class Invidious::Jobs::RefreshChannelsJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
private getter db : DB::Database private getter db : DB::Database
def initialize(@db) def initialize(@db)

View File

@ -1,6 +1,4 @@
class Invidious::Jobs::RefreshFeedsJob < Invidious::Jobs::BaseJob class Invidious::Jobs::RefreshFeedsJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
private getter db : DB::Database private getter db : DB::Database
def initialize(@db) def initialize(@db)

View File

@ -1,6 +1,4 @@
class Invidious::Jobs::SubscribeToFeedsJob < Invidious::Jobs::BaseJob class Invidious::Jobs::SubscribeToFeedsJob < Invidious::Jobs::BaseJob
Log = ::Log.for(self)
private getter db : DB::Database private getter db : DB::Database
private getter hmac_key : String private getter hmac_key : String