diff --git a/sync/service/postgres.go b/sync/service/postgres.go index 2d0d8ba..9f169ff 100644 --- a/sync/service/postgres.go +++ b/sync/service/postgres.go @@ -59,13 +59,15 @@ func NewPostgres(host, port, dbname, user, password string) (*Postgres, error) { } func (p *Postgres) Update(i item.Item, ts time.Time) error { - var recurrerJSON []byte - var err error + var recurrerJSON interface{} if i.Recurrer != nil { + var err error recurrerJSON, err = json.Marshal(i.Recurrer) if err != nil { return fmt.Errorf("%w: %v", ErrPostgresFailure, err) } + } else { + recurrerJSON = nil } _, err = p.db.Exec(`