http service: add endpoint for websocket session count
This commit is contained in:
@@ -27,6 +27,7 @@ package net.runelite.http.service.session;
|
||||
import java.time.Instant;
|
||||
import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import net.runelite.http.service.ws.SessionManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -97,4 +98,10 @@ public class SessionController
|
||||
{
|
||||
return sessionService.getCount();
|
||||
}
|
||||
|
||||
@RequestMapping("/wscount")
|
||||
public int wscount()
|
||||
{
|
||||
return SessionManager.getCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,9 @@ public class SessionManager
|
||||
{
|
||||
return sessions.get(uuid);
|
||||
}
|
||||
|
||||
public static int getCount()
|
||||
{
|
||||
return sessions.size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user