mirror of
https://github.com/Athou/commafeed.git
synced 2026-09-23 20:45:07 +00:00
35 lines
917 B
Java
35 lines
917 B
Java
package com.commafeed;
|
|
|
|
import jakarta.enterprise.event.Observes;
|
|
import jakarta.inject.Singleton;
|
|
|
|
import com.commafeed.backend.feed.FeedRefreshEngine;
|
|
import com.commafeed.backend.task.TaskScheduler;
|
|
import com.commafeed.security.password.PasswordConstraintValidator;
|
|
|
|
import io.quarkus.runtime.ShutdownEvent;
|
|
import io.quarkus.runtime.StartupEvent;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
@Singleton
|
|
@RequiredArgsConstructor
|
|
public class CommaFeedApplication {
|
|
|
|
private final FeedRefreshEngine feedRefreshEngine;
|
|
private final TaskScheduler taskScheduler;
|
|
private final CommaFeedConfiguration config;
|
|
|
|
public void start(@Observes StartupEvent ev) {
|
|
PasswordConstraintValidator.setMinimumPasswordLength(config.users().minimumPasswordLength());
|
|
|
|
feedRefreshEngine.start();
|
|
taskScheduler.start();
|
|
}
|
|
|
|
public void stop(@Observes ShutdownEvent ev) {
|
|
feedRefreshEngine.stop();
|
|
taskScheduler.stop();
|
|
}
|
|
|
|
}
|