|
|
|
@ -6,8 +6,6 @@ import (
|
|
|
|
|
"FRMS/internal/pkg/manager"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -90,17 +88,13 @@ func (r *ReactorManager) UpdateClient(cl *Client) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReactorStatusHandler implements a gRPC handler that is called by reactors.
|
|
|
|
|
// Takes in a context and request which has reactor and device information.
|
|
|
|
|
// For now, loops over devices and logs information about their status.
|
|
|
|
|
func (r *ReactorManager) ReactorStatusHandler(
|
|
|
|
|
ctx context.Context,
|
|
|
|
|
req *pb.ReactorStatusPing,
|
|
|
|
|
) (*pb.ReactorStatusResponse, error) {
|
|
|
|
|
// ReactorDeviceHandler processes incoming device information and
|
|
|
|
|
// updates the manager accordingly.
|
|
|
|
|
func (r *ReactorManager) ReactorDeviceHandler(devs []*pb.Device) error {
|
|
|
|
|
|
|
|
|
|
logging.Debug(logging.DClient, "RMA %v recieved ping", r.Id)
|
|
|
|
|
|
|
|
|
|
for _, dev := range req.GetDevices() {
|
|
|
|
|
for _, dev := range devs {
|
|
|
|
|
logging.Debug(
|
|
|
|
|
logging.DClient,
|
|
|
|
|
"RMA %v device %v is %v",
|
|
|
|
@ -110,5 +104,5 @@ func (r *ReactorManager) ReactorStatusHandler(
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &pb.ReactorStatusResponse{Id: int32(r.Id)}, nil
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|