all database operations now take a context.Context, which is propagated through from sources

This commit is contained in:
2025-12-20 22:29:26 -07:00
parent 9e6bf2feda
commit 5c8bb8dd5e
39 changed files with 605 additions and 504 deletions
+5 -2
View File
@@ -9,15 +9,18 @@
// The database package contains database management and storage logic.
package database
import "context"
/* AmIsEmailAddressBanned returns true if the given E-mail address is on the "banned" list.
* Parameters:
* ctx - Standard Go context value.
* address - The E-mail address to be checked.
* Returns:
* true if the address is banned, false if not.
* Standard Go error status.
*/
func AmIsEmailAddressBanned(address string) (bool, error) {
rs, err := amdb.Query("SELECT by_uid FROM emailban WHERE address = ?", address)
func AmIsEmailAddressBanned(ctx context.Context, address string) (bool, error) {
rs, err := amdb.QueryContext(ctx, "SELECT by_uid FROM emailban WHERE address = ?", address)
if err != nil {
return false, err
}