all database operations now take a context.Context, which is propagated through from sources
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user