updated libraries, adapted code to library changes

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-08-31 15:05:21 +02:00
parent e37cbd0e90
commit 80f92263b3
35 changed files with 450 additions and 373 deletions
+5 -4
View File
@@ -14,11 +14,12 @@ dependencies {
implementation("de.srsoftware:configuration.api:1.0.0")
implementation("de.srsoftware:configuration.json:1.0.1")
implementation("de.srsoftware:tools.http:1.2.4")
implementation("de.srsoftware:tools.logging:1.2.0")
implementation("de.srsoftware:tools.container:1.0.6")
implementation("de.srsoftware:tools.http:6.0.5")
implementation("de.srsoftware:tools.logging:1.3.2")
implementation("de.srsoftware:tools.plugin:1.0.2")
implementation("de.srsoftware:tools.util:1.3.0")
implementation("de.srsoftware:tools.web:1.3.14")
implementation("de.srsoftware:tools.util:2.1.1")
implementation("de.srsoftware:tools.web:1.3.16")
implementation("com.mysql:mysql-connector-j:9.1.0")
implementation("org.json:json:20240303")
}
@@ -219,7 +219,8 @@ public class AutoImporter implements Runnable, ClassListener {
if (lastImport == null || Duration.between(lastImport,now).minusHours(6).isPositive()) {
for (var importer : importers) {
try {
importer.fetch().map(AutoImporter::autoAddTags).forEach(event -> saveOrUpdate(event,importer));
var events = importer.fetch().map(AutoImporter::autoAddTags).toList();
for (var event : events) saveOrUpdate(event, importer);
} catch (IOException e) {
LOG.log(WARNING, "{0}.fetch() failed", importer, e);
}
@@ -274,15 +275,16 @@ public class AutoImporter implements Runnable, ClassListener {
} else {
res = db.add(appointment);
}
var saved = res.optional();
Optional<Appointment> saved = res.optional();
var name = importer.getClass().getSimpleName();
if (saved.isPresent()){
if (loaded.isPresent()) {
LOG.log(INFO, "UPDATED: {0} from {1}.", saved.get(),importer.getClass().getSimpleName());
LOG.log(INFO, "UPDATED: {0} from {1}.", saved.get().title(),name);
} else {
LOG.log(INFO, "CREATED: {0} from {1}.", saved.get(),importer.getClass().getSimpleName());
LOG.log(INFO, "CREATED: {0} from {1}.", saved.get().title(),name);
}
} else {
LOG.log(WARNING,"Failed to save {0} from {1}!",appointment,importer.getClass().getSimpleName());
LOG.log(WARNING,"Failed to save {0} from {1}!",appointment,name);
}
}