Compare commits
2 Commits
6bf8417451
...
eba40a4eee
Author | SHA1 | Date | |
---|---|---|---|
eba40a4eee | |||
13484d1834 |
|
@ -195,7 +195,7 @@ func (b *memoryBackend) ChannelsCreate(name string) (microsub.Channel, error) {
|
||||||
try++
|
try++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if n, err := result.RowsAffected(); err != nil {
|
if n, err := result.RowsAffected(); err == nil {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
b.broker.Notifier <- sse.Message{Event: "new channel", Object: channelMessage{1, channel}}
|
b.broker.Notifier <- sse.Message{Event: "new channel", Object: channelMessage{1, channel}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ WHERE "channel_id" = $1
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
} else {
|
} else {
|
||||||
args = append(args, b)
|
args = append(args, b)
|
||||||
qb.WriteString(` AND "published_at" >= $2`)
|
qb.WriteString(` AND "published_at" > $2`)
|
||||||
}
|
}
|
||||||
} else if after != "" {
|
} else if after != "" {
|
||||||
b, err := time.Parse(time.RFC3339, after)
|
b, err := time.Parse(time.RFC3339, after)
|
||||||
|
@ -196,7 +196,7 @@ WHERE "channel_id" = $1
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasMoreBefore(conn *sql.Conn, before string) bool {
|
func hasMoreBefore(conn *sql.Conn, before string) bool {
|
||||||
row := conn.QueryRowContext(context.Background(), `SELECT COUNT(*) FROM "items" WHERE "published_at" >= $1`, before)
|
row := conn.QueryRowContext(context.Background(), `SELECT COUNT(*) FROM "items" WHERE "published_at" > $1`, before)
|
||||||
var count int
|
var count int
|
||||||
if err := row.Scan(&count); err == sql.ErrNoRows {
|
if err := row.Scan(&count); err == sql.ErrNoRows {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user