Skip to content

Commit

Permalink
Fixes #22646: We should initialize campaign service after plugin were…
Browse files Browse the repository at this point in the history
… added or else current events will be skipped (before being added again)
  • Loading branch information
VinceMacBuche committed Apr 24, 2023
1 parent 7a213a1 commit 8b676de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ class Boot extends Loggable {
//// init plugin code (ie: bootstrap their objects / connections / etc ////
val plugins = initPlugins()

// Run post plugin init actions:
RudderConfig.postPluginInitActions

////////// CACHE INVALIDATION FOR RESOURCES //////////
// fails on invalid JSON body because it's unsufferable
LiftRules.statelessDispatch.append {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,12 @@ object RudderConfig extends Loggable {
}
}

def postPluginInitActions = {
// todo: scheduler interval should be a property
ZioRuntime.unsafeRun(jsonReportsAnalyzer.start(5.seconds).forkDaemon.provideLayer(ZioRuntime.layers))
ZioRuntime.unsafeRun(MainCampaignService.start(mainCampaignService))
}

}

/*
Expand Down Expand Up @@ -3162,11 +3168,6 @@ object RudderConfigInit {
lazy val mainCampaignService = new MainCampaignService(campaignEventRepo, campaignRepo, uuidGen, 1, 1)
lazy val jsonReportsAnalyzer = JSONReportsAnalyser(reportsRepository, propertyRepository)

// todo: scheduler interval should be a property
ZioRuntime.unsafeRun(jsonReportsAnalyzer.start(5.seconds).forkDaemon.provideLayer(ZioRuntime.layers))

ZioRuntime.unsafeRun(MainCampaignService.start(mainCampaignService))

/**
* *************************************************
* Bootstrap check actions
Expand Down

0 comments on commit 8b676de

Please sign in to comment.