mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 04:58:59 +00:00
(feed) Wipe the feeds db and start over from system URLs periodically.
This commit is contained in:
parent
b8e0dc93d7
commit
a293266ccd
@ -24,6 +24,7 @@ import java.io.IOException;
|
||||
import java.net.http.HttpClient;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@ -89,7 +90,12 @@ public class FeedFetcherService {
|
||||
// RSS exports instead
|
||||
|
||||
Collection<FeedDefinition> definitions = feedDb.getAllFeeds();
|
||||
if (definitions == null) {
|
||||
|
||||
// If we didn't get any definitions, or approximately every other month, read them from the system
|
||||
// to get the latest feeds. As the feeds known by the system have a lot of dead links, we don't
|
||||
// want to do this too often.
|
||||
final LocalDate today = LocalDate.now();
|
||||
if (definitions == null || (today.getDayOfMonth() == 1 && (today.getMonthValue() % 2) == 0)) {
|
||||
definitions = readDefinitionsFromSystem();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user