File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/com/condation/cms/modules/git Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 2121 * <http://www.gnu.org/licenses/gpl-3.0.html>.
2222 * #L%
2323 */
24+ import com .condation .cms .api .eventbus .EventBus ;
25+ import com .condation .cms .api .eventbus .events .RepoCheckoutEvent ;
2426import com .condation .cms .api .extensions .server .ServerLifecycleExtensionPoint ;
2527import com .condation .cms .api .feature .features .InjectorFeature ;
2628import com .condation .cms .api .scheduler .CronJobScheduler ;
@@ -49,12 +51,17 @@ public void stopped() {
4951 @ Override
5052 public void started () {
5153 try {
52- var scheduler = getContext ().get (InjectorFeature .class ).injector ().getInstance (Key .get (CronJobScheduler .class , Names .named ("server" )));
54+ var injector = getContext ().get (InjectorFeature .class ).injector ();
55+ var scheduler = injector .getInstance (Key .get (CronJobScheduler .class , Names .named ("server" )));
5356
5457 REPO_MANAGER = new RepositoryManager (scheduler );
5558
5659 REPO_MANAGER .init (Path .of ("config/git.yaml" ));
5760
61+
62+ injector .getInstance (Key .get (EventBus .class , Names .named ("server" ))).register (RepoCheckoutEvent .class , (event ) -> {
63+ REPO_MANAGER .updateRepo (event .repo ());
64+ });
5865 } catch (Exception ex ) {
5966 log .error ("error starting git module" , ex );
6067 }
You can’t perform that action at this time.
0 commit comments