|
1 | 1 | package edu.tamu.app.job; |
2 | 2 |
|
| 3 | +import static edu.tamu.framework.enums.ApiResponseType.SUCCESS; |
| 4 | + |
3 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
4 | 6 | import org.springframework.messaging.simp.SimpMessagingTemplate; |
5 | 7 | import org.springframework.scheduling.annotation.Scheduled; |
6 | 8 | import org.springframework.stereotype.Service; |
7 | 9 |
|
8 | | -import edu.tamu.app.service.OverallStatusService; |
| 10 | +import edu.tamu.app.service.MonitorService; |
9 | 11 | import edu.tamu.framework.model.ApiResponse; |
10 | 12 |
|
11 | | -import static edu.tamu.framework.enums.ApiResponseType.SUCCESS; |
12 | | - |
13 | 13 | @Service |
14 | | -public class UpdateOveralStatuses { |
| 14 | +public class UpdateServiceStatuses { |
15 | 15 |
|
16 | 16 | @Autowired |
17 | | - OverallStatusService overallStatusService; |
| 17 | + MonitorService monitorService; |
18 | 18 |
|
19 | 19 | @Autowired |
20 | 20 | SimpMessagingTemplate simpMessagingTemplate; |
21 | 21 |
|
22 | | - @Scheduled(fixedRate=(1 * 30 * 1000)) |
| 22 | + @Scheduled(fixedRate=(10*60*1000)) |
23 | 23 | public void updateOveralStatuses() { |
24 | | - overallStatusService.updateStatuses(); |
| 24 | + monitorService.updateAll(); |
25 | 25 |
|
26 | | - simpMessagingTemplate.convertAndSend("/channel/status/overall-full", new ApiResponse(SUCCESS, overallStatusService.getOverallStatusFull())); |
27 | | - simpMessagingTemplate.convertAndSend("/channel/status/overall-public", new ApiResponse(SUCCESS, overallStatusService.getOverallStatusPublic())); |
| 26 | + simpMessagingTemplate.convertAndSend("/channel/status/overall-full", new ApiResponse(SUCCESS, monitorService.getOverallStatus())); |
| 27 | + simpMessagingTemplate.convertAndSend("/channel/status/overall-public", new ApiResponse(SUCCESS, monitorService.getOverallStatusPublic())); |
28 | 28 |
|
29 | 29 | } |
30 | 30 |
|
|
0 commit comments