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

Fix some settings not being applied properly #661

Merged
merged 5 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ object ProtoBackupExport : ProtoBackupBase() {
timeOfDay
)
},
::scheduleAutomatedBackupTask
::scheduleAutomatedBackupTask,
ignoreInitialValue = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this work?
I think I started the interval in the ServerSetup because the ProtoBackupExport never gets loaded unless a backup gets created

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should, objects are statically initialized

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Though I see now that they are initialized in ServerSetup, so I'll revert these ones

Copy link
Collaborator

@schroda schroda Aug 20, 2023

Choose a reason for hiding this comment

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

I think I confused it with the Updater, because that only gets initialized lazily, so I just didn't change it like this when I added the server setting subscription

)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Updater : IUpdater {
private var currentUpdateTaskId = ""

init {
serverConfig.subscribeTo(serverConfig.globalUpdateInterval, ::scheduleUpdateTask)
serverConfig.subscribeTo(serverConfig.globalUpdateInterval, ::scheduleUpdateTask, ignoreInitialValue = false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The interval also gets started in the ServerConfig
I think I did it that way for the same reason as for the backup interval

serverConfig.subscribeTo(
serverConfig.maxSourcesInParallel,
{ value ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fun applicationSetup() {
} else {
setLogLevel(Level.INFO)
}
})
}, ignoreInitialValue = false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this

        // set log level early
        if (debugLogsEnabled(config)) {
            setLogLevel(Level.DEBUG)
        }

still needed in the ConfigManger with this change?

I believe the issue with the debug logs is because I forgot to set the default log level, which was INFO before in the logback config file, when I added the file logging

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it still is, configs would get initialized and there are some logs in the config manager that should be outputted


// Application dirs
val applicationDirs = ApplicationDirs()
Expand Down Expand Up @@ -206,7 +206,8 @@ fun applicationSetup() {
System.getProperties()["socksProxyHost"] = ""
System.getProperties()["socksProxyPort"] = ""
}
}
},
ignoreInitialValue = false
)

// AES/CBC/PKCS7Padding Cypher provider for zh.copymanga
Expand Down
Loading