feed controller: return service unavailable if feed isn't loaded

This commit is contained in:
Adam
2020-03-26 10:43:17 -04:00
parent b0a7e779be
commit e03cc3c19d

View File

@@ -38,6 +38,7 @@ import net.runelite.http.service.feed.osrsnews.OSRSNewsService;
import net.runelite.http.service.feed.twitter.TwitterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
@@ -122,7 +123,8 @@ public class FeedController
{
if (memoizedFeed == null)
{
return ResponseEntity.notFound()
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.cacheControl(CacheControl.noCache())
.build();
}