Skip to content

Commit

Permalink
cache save session
Browse files Browse the repository at this point in the history
  • Loading branch information
fufuu committed Oct 10, 2024
1 parent fe3d129 commit e1aa5b2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.usf.inspect.core.DispatchState;
import org.usf.inspect.server.dao.RequestDao;
import org.usf.inspect.server.model.ServerSession;
import org.usf.inspect.server.service.RequestService;
import org.usf.inspect.server.service.SessionQueueService;

import lombok.RequiredArgsConstructor;
Expand All @@ -27,7 +28,7 @@
public class CacheController {

private final ObjectMapper mapper;
private final RequestDao dao;
private final RequestService service;
private final SessionQueueService queue;

RestTemplate defaultRestTemplate() {
Expand All @@ -53,7 +54,7 @@ public int addSession(@RequestParam(name = "host") String host) {
var rt = defaultRestTemplate();
var ses = rt.getForObject(host + "/cache", ServerSession[].class);
if(ses != null && ses.length > 0) {
dao.saveSessions(Arrays.asList(ses));
service.addSessions(Arrays.asList(ses));
return ses.length;
}
return 0;
Expand Down

0 comments on commit e1aa5b2

Please sign in to comment.