Skip to content

Commit dc5d76d

Browse files
authored
fix s3 thing status (openhab#14925)
Signed-off-by: Alexandr Salamatov <[email protected]>
1 parent 3130a67 commit dc5d76d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bundles/org.openhab.binding.folderwatcher/src/main/java/org/openhab/binding/folderwatcher/internal/api/S3Actions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private List<String> listObjectsV2(String prefix, Map<String, String> headers, M
115115
List<String> returnList = new ArrayList<>();
116116

117117
if (nameNodesList.getLength() == 0) {
118-
throw new Exception("No files deceted in the bucket");
118+
return returnList;
119119
}
120120

121121
for (int i = 0; i < nameNodesList.getLength(); i++) {

bundles/org.openhab.binding.folderwatcher/src/main/java/org/openhab/binding/folderwatcher/internal/handler/S3BucketWatcherHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public void initialize() {
8989

9090
if (refreshS3BucketInformation()) {
9191
if (config.pollIntervalS3 > 0) {
92-
updateStatus(ThingStatus.ONLINE);
9392
executionJob = scheduler.scheduleWithFixedDelay(this::refreshS3BucketInformation, config.pollIntervalS3,
9493
config.pollIntervalS3, TimeUnit.SECONDS);
9594
} else {
@@ -104,6 +103,7 @@ private boolean refreshS3BucketInformation() {
104103
List<String> currentS3Listing = new ArrayList<>();
105104
try {
106105
currentS3Listing = s3.listBucket(config.s3Path);
106+
updateStatus(ThingStatus.ONLINE);
107107
List<String> difS3Listing = new ArrayList<>(currentS3Listing);
108108
difS3Listing.removeAll(previousS3Listing);
109109
difS3Listing.forEach(file -> triggerChannel(CHANNEL_NEWFILE, file));

0 commit comments

Comments
 (0)