Add a bit more logging for cursor values
parent
5d3d562ecc
commit
fc5307a971
|
@ -78,6 +78,11 @@ func (c *Consumer) run(ctx context.Context) {
|
||||||
func (c *Consumer) runOnce(ctx context.Context) error {
|
func (c *Consumer) runOnce(ctx context.Context) error {
|
||||||
log := zerolog.Ctx(ctx)
|
log := zerolog.Ctx(ctx)
|
||||||
|
|
||||||
|
log.Info().
|
||||||
|
Int64("cursor", c.remote.Cursor).
|
||||||
|
Int64("first_cursor_since_reset", c.remote.FirstCursorSinceReset).
|
||||||
|
Msgf("Connecting to firehose of %s...", c.remote.Host)
|
||||||
|
|
||||||
addr, err := url.Parse(c.remote.Host)
|
addr, err := url.Parse(c.remote.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("parsing URL %q: %s", c.remote.Host, err)
|
return fmt.Errorf("parsing URL %q: %s", c.remote.Host, err)
|
||||||
|
@ -175,6 +180,11 @@ func (c *Consumer) checkForCursorReset(ctx context.Context, seq int64) error {
|
||||||
// hack to detect cursor resets upon connection for implementations
|
// hack to detect cursor resets upon connection for implementations
|
||||||
// that don't emit an explicit #info when connecting with an outdated cursor.
|
// that don't emit an explicit #info when connecting with an outdated cursor.
|
||||||
|
|
||||||
|
zerolog.Ctx(ctx).Info().
|
||||||
|
Int64("cursor", c.remote.Cursor).
|
||||||
|
Int64("remote_cursor", seq).
|
||||||
|
Msgf("Checking for possible cursor reset")
|
||||||
|
|
||||||
if seq == c.remote.Cursor+1 {
|
if seq == c.remote.Cursor+1 {
|
||||||
// No reset.
|
// No reset.
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue