aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/SignatureManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-10 15:40:15 +0300
committerGravatar Vitaly Takmazov2018-10-10 15:40:15 +0300
commit5a2b506b5ecb56793807aacb47b7615bba80a7cc (patch)
treeb36e28e1fcc0058da11720b5d0c06d28a51905e1 /juick-server/src/main/java/com/juick/server/SignatureManager.java
parent07903dbec6fe386940fe373f778e69a153a28e6f (diff)
ActivityPub: clean up 410 followers
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/SignatureManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/SignatureManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/SignatureManager.java b/juick-server/src/main/java/com/juick/server/SignatureManager.java
index c39cdac9..869edbfc 100644
--- a/juick-server/src/main/java/com/juick/server/SignatureManager.java
+++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java
@@ -3,10 +3,12 @@ package com.juick.server;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.juick.server.api.activity.model.Context;
import com.juick.server.api.activity.model.Person;
+import com.juick.service.activities.DeleteUserEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpClientErrorException;
@@ -83,6 +85,10 @@ public class SignatureManager {
return Optional.of(new RestTemplate().getForEntity(contextUri, Context.class).getBody());
} catch (HttpClientErrorException e) {
logger.warn("Cannot identify {}", contextUri);
+ if (e.getStatusCode().equals(HttpStatus.GONE)) {
+ logger.warn("Server report {} is gone, deleting", contextUri);
+ new DeleteUserEvent(this, contextUri.toASCIIString());
+ }
}
return Optional.empty();
}