This commit is contained in:
parent
2a11bc1fc7
commit
ac56638664
|
@ -9,7 +9,7 @@ services:
|
|||
- database-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_DB: ekster
|
||||
POSTGRES_USER: ekster
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: simple
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
|
||||
|
|
|
@ -219,6 +219,8 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, err.Error(), 500)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
log.Println("No uids specified for mark read")
|
||||
}
|
||||
} else {
|
||||
http.Error(w, fmt.Sprintf("unknown method in timeline %s\n", method), 500)
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"p83.nl/go/ekster/pkg/microsub"
|
||||
|
||||
// load pq for postgres
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/lib/pq"
|
||||
)
|
||||
|
||||
type postgresStream struct {
|
||||
|
@ -223,7 +223,7 @@ func (p *postgresStream) MarkRead(uids []string) error {
|
|||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
_, err = conn.ExecContext(context.Background(), `UPDATE "items" SET is_read = 1 WHERE "uid" IN ($1)`, uids)
|
||||
_, err = conn.ExecContext(context.Background(), `UPDATE "items" SET is_read = 1 WHERE "uid" IN ($1)`, pq.Array(uids))
|
||||
if err != nil {
|
||||
return fmt.Errorf("while marking as read: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user