Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gcalbot/gcalbot/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ func (d *DB) InsertChannel(account *Account, channel Channel) error {
})
}

func (d *DB) UpdateChannel(oldChannelID, newChannelID string, expiry time.Time) error {
func (d *DB) UpdateChannel(oldChannelID, newChannelID string, resourceID string, expiry time.Time) error {
return d.RunTxn(func(tx *sql.Tx) error {
_, err := tx.Exec(`
UPDATE channel
SET channel_id = ?, expiry = ?
SET channel_id = ?, resource_id = ?, expiry = ?
WHERE channel_id = ?
`, newChannelID, expiry, oldChannelID)
`, newChannelID, resourceID, expiry, oldChannelID)
return err
})
}
Expand Down
2 changes: 1 addition & 1 deletion gcalbot/gcalbot/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (r *RenewChannelScheduler) renewChannel(account *Account, channel *Channel)
return err
}

err = r.db.UpdateChannel(channel.ChannelID, newChannelID, time.Unix(res.Expiration/1e3, 0))
err = r.db.UpdateChannel(channel.ChannelID, newChannelID, res.ResourceId, time.Unix(res.Expiration/1e3, 0))
if err != nil {
return err
}
Expand Down
Loading