Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (sinks): set sink status when deployment status change #2709

Merged
merged 16 commits into from
Oct 4, 2023
3 changes: 2 additions & 1 deletion sinks/api/http/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ package http

import (
"context"
"time"

"github.com/orb-community/orb/sinks"
"github.com/orb-community/orb/sinks/authentication_type"
"github.com/orb-community/orb/sinks/backend"
"go.uber.org/zap"
"time"
)

var _ sinks.SinkService = (*loggingMiddleware)(nil)
Expand Down
3 changes: 2 additions & 1 deletion sinks/api/http/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ package http

import (
"context"
"time"

"github.com/go-kit/kit/metrics"
"github.com/mainflux/mainflux"
"github.com/orb-community/orb/pkg/errors"
"github.com/orb-community/orb/sinks"
"github.com/orb-community/orb/sinks/authentication_type"
"github.com/orb-community/orb/sinks/backend"
"go.uber.org/zap"
"time"
)

var _ sinks.SinkService = (*metricsMiddleware)(nil)
Expand Down
2 changes: 1 addition & 1 deletion sinks/redis/consumer/sink_status_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (s *sinkStatusListener) ReceiveMessage(ctx context.Context, message redis.X
gotSink.Error = event.Msg
}
gotSink.State = newState
_, err = s.sinkService.UpdateSinkInternal(ctx, gotSink)
err = s.sinkService.ChangeSinkStateInternal(ctx, gotSink.ID, gotSink.Error, gotSink.MFOwnerID, gotSink.State)
if err != nil {
logger.Error("failed to update sink", zap.String("owner_id", event.OwnerID),
zap.String("sink_id", event.SinkID), zap.Error(err))
Expand Down
1 change: 1 addition & 0 deletions sinks/redis/producer/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package producer

import (
"context"

"github.com/orb-community/orb/sinks/authentication_type"

"github.com/go-redis/redis/v8"
Expand Down
3 changes: 2 additions & 1 deletion sinks/sinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ package sinks
import (
"context"
"database/sql/driver"
"time"

"github.com/orb-community/orb/pkg/errors"
"github.com/orb-community/orb/pkg/types"
"github.com/orb-community/orb/sinks/authentication_type"
"github.com/orb-community/orb/sinks/authentication_type/basicauth"
"github.com/orb-community/orb/sinks/backend"
"go.uber.org/zap"
"time"
)

var (
Expand Down
Loading