feed controller: return service unavailable if feed isn't loaded
This commit is contained in:
@@ -38,6 +38,7 @@ import net.runelite.http.service.feed.osrsnews.OSRSNewsService;
|
|||||||
import net.runelite.http.service.feed.twitter.TwitterService;
|
import net.runelite.http.service.feed.twitter.TwitterService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.CacheControl;
|
import org.springframework.http.CacheControl;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -122,7 +123,8 @@ public class FeedController
|
|||||||
{
|
{
|
||||||
if (memoizedFeed == null)
|
if (memoizedFeed == null)
|
||||||
{
|
{
|
||||||
return ResponseEntity.notFound()
|
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
|
||||||
|
.cacheControl(CacheControl.noCache())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user