You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/03/14 12:14:43 UTC
(incubator-devlake) branch kw-upgrade-failed created (now a4b7fafd6)
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a change to branch kw-upgrade-failed
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at a4b7fafd6 chore: add log for initplugins and db migration
This branch includes the following new commits:
new a4b7fafd6 chore: add log for initplugins and db migration
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: chore: add log for initplugins and db migration
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-upgrade-failed
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit a4b7fafd666f33f56b0ef93fc8f6501fa381e249
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Thu Mar 14 20:13:21 2024 +0800
chore: add log for initplugins and db migration
---
backend/core/plugin/hub.go | 10 +++++++++-
backend/server/services/init.go | 7 ++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/backend/core/plugin/hub.go b/backend/core/plugin/hub.go
index 6788c9057..b0a50b786 100644
--- a/backend/core/plugin/hub.go
+++ b/backend/core/plugin/hub.go
@@ -73,6 +73,13 @@ func FindPluginNameBySubPkgPath(subPkgPath string) (string, errors.Error) {
}
func InitPlugins(basicRes context.BasicRes) {
+ if basicRes == nil {
+ panic("basicRes is nil")
+ } else if basicRes.GetDal() == nil {
+ panic("basicRes.GetDal() return nil")
+ }
+ logger := basicRes.GetLogger()
+ logger.Info("start initialize plugins")
for pluginName, pluginMeta := range plugins {
if pluginEntry, ok := pluginMeta.(PluginInit); ok {
err := pluginEntry.Init(basicRes)
@@ -80,7 +87,8 @@ func InitPlugins(basicRes context.BasicRes) {
panic(fmt.Errorf("failed to initialize plugin %v due to %w", pluginName, err))
}
} else {
- basicRes.GetLogger().Info("plugin: %s doesn't implement 'PluginInit', it will be skipped.", pluginName)
+ logger.Info("plugin: %s doesn't implement 'PluginInit', it will be skipped.", pluginName)
}
}
+ logger.Info("plugins initialized succesfully")
}
diff --git a/backend/server/services/init.go b/backend/server/services/init.go
index b40d99ff2..6d587b64d 100644
--- a/backend/server/services/init.go
+++ b/backend/server/services/init.go
@@ -105,16 +105,21 @@ func Init() {
panic(err)
}
}
- logger.Info("Db migration confirmation needed")
+
+ if !forceMigration {
+ logger.Info("db migration confirmation needed")
+ }
}
// ExecuteMigration executes all pending migration scripts and initialize services module
func ExecuteMigration() errors.Error {
// apply all pending migration scripts
+ logger.Info("start db migration")
err := migrator.Execute()
if err != nil {
return err
}
+ logger.Info("db migration finished successfully")
// cronjob for blueprint triggering
location := cron.WithLocation(time.UTC)