mirror of
https://github.com/Athou/commafeed.git
synced 2026-10-25 14:39:02 +00:00
44 lines
1.2 KiB
Java
44 lines
1.2 KiB
Java
package com.commafeed;
|
|
|
|
import com.commafeed.backend.feed.FeedRefreshEngine;
|
|
import com.commafeed.backend.feed.ImageProxyUrl;
|
|
import com.commafeed.backend.task.TaskScheduler;
|
|
import com.commafeed.security.password.PasswordConstraintValidator;
|
|
import io.quarkus.runtime.ShutdownEvent;
|
|
import io.quarkus.runtime.StartupEvent;
|
|
import jakarta.enterprise.event.Observes;
|
|
import jakarta.inject.Singleton;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@Slf4j
|
|
@Singleton
|
|
@RequiredArgsConstructor
|
|
public class CommaFeedApplication {
|
|
|
|
private final FeedRefreshEngine feedRefreshEngine;
|
|
private final TaskScheduler taskScheduler;
|
|
private final CommaFeedConfiguration config;
|
|
|
|
public void start(@Observes StartupEvent ev) {
|
|
log.info("starting up...");
|
|
|
|
PasswordConstraintValidator.setMinimumPasswordLength(
|
|
config.users().minimumPasswordLength());
|
|
|
|
if (config.imageProxyEnabled()) {
|
|
ImageProxyUrl.generateKey();
|
|
}
|
|
|
|
feedRefreshEngine.start();
|
|
taskScheduler.start();
|
|
}
|
|
|
|
public void stop(@Observes ShutdownEvent ev) {
|
|
log.info("shutting down...");
|
|
|
|
feedRefreshEngine.stop();
|
|
taskScheduler.stop();
|
|
}
|
|
}
|