This commit is contained in:
parent
877addb1fc
commit
4e7b11d35a
|
@ -25,7 +25,7 @@ func (s *postgres) Close() error {
|
|||
|
||||
func (s *postgres) Subscribe(topic string, sub Subscriber) error {
|
||||
_, err := s.db.Exec(
|
||||
`INSERT INTO "subscribers" ("topic", "callback", "lease_seconds", "secret", "created") VALUES (?, ?, ?, ?, now())`,
|
||||
`INSERT INTO "subscribers" ("topic", "callback", "lease_seconds", "secret", "created") VALUES ($1, $2, $3, $4, now())`,
|
||||
topic,
|
||||
sub.Callback,
|
||||
sub.LeaseSeconds,
|
||||
|
@ -36,7 +36,7 @@ func (s *postgres) Subscribe(topic string, sub Subscriber) error {
|
|||
|
||||
func (s *postgres) Unsubscribe(topic, callback string) error {
|
||||
_, err := s.db.Exec(
|
||||
`DELETE FROM "subscribers" WHERE "topic" = ? AND "callback" = ?`,
|
||||
`DELETE FROM "subscribers" WHERE "topic" = ? AND "callback" = $1`,
|
||||
topic,
|
||||
callback,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user