Changeset 652 in code for trunk/db_postgres.go
- Timestamp:
- Oct 18, 2021, 5:15:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/db_postgres.go
r645 r652 148 148 } 149 149 150 func (db *PostgresDB) Stats( ) (*DatabaseStats, error) {151 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)150 func (db *PostgresDB) Stats(ctx context.Context) (*DatabaseStats, error) { 151 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 152 152 defer cancel() 153 153 … … 164 164 } 165 165 166 func (db *PostgresDB) ListUsers( ) ([]User, error) {167 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)166 func (db *PostgresDB) ListUsers(ctx context.Context) ([]User, error) { 167 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 168 168 defer cancel() 169 169 … … 193 193 } 194 194 195 func (db *PostgresDB) GetUser( username string) (*User, error) {196 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)195 func (db *PostgresDB) GetUser(ctx context.Context, username string) (*User, error) { 196 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 197 197 defer cancel() 198 198 … … 211 211 } 212 212 213 func (db *PostgresDB) StoreUser( user *User) error {214 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)213 func (db *PostgresDB) StoreUser(ctx context.Context, user *User) error { 214 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 215 215 defer cancel() 216 216 … … 235 235 } 236 236 237 func (db *PostgresDB) DeleteUser( id int64) error {238 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)237 func (db *PostgresDB) DeleteUser(ctx context.Context, id int64) error { 238 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 239 239 defer cancel() 240 240 … … 243 243 } 244 244 245 func (db *PostgresDB) ListNetworks( userID int64) ([]Network, error) {246 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)245 func (db *PostgresDB) ListNetworks(ctx context.Context, userID int64) ([]Network, error) { 246 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 247 247 defer cancel() 248 248 … … 287 287 } 288 288 289 func (db *PostgresDB) StoreNetwork( userID int64, network *Network) error {290 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)289 func (db *PostgresDB) StoreNetwork(ctx context.Context, userID int64, network *Network) error { 290 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 291 291 defer cancel() 292 292 … … 339 339 } 340 340 341 func (db *PostgresDB) DeleteNetwork( id int64) error {342 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)341 func (db *PostgresDB) DeleteNetwork(ctx context.Context, id int64) error { 342 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 343 343 defer cancel() 344 344 … … 347 347 } 348 348 349 func (db *PostgresDB) ListChannels( networkID int64) ([]Channel, error) {350 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)349 func (db *PostgresDB) ListChannels(ctx context.Context, networkID int64) ([]Channel, error) { 350 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 351 351 defer cancel() 352 352 … … 381 381 } 382 382 383 func (db *PostgresDB) StoreChannel( networkID int64, ch *Channel) error {384 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)383 func (db *PostgresDB) StoreChannel(ctx context.Context, networkID int64, ch *Channel) error { 384 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 385 385 defer cancel() 386 386 … … 409 409 } 410 410 411 func (db *PostgresDB) DeleteChannel( id int64) error {412 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)411 func (db *PostgresDB) DeleteChannel(ctx context.Context, id int64) error { 412 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 413 413 defer cancel() 414 414 … … 417 417 } 418 418 419 func (db *PostgresDB) ListDeliveryReceipts( networkID int64) ([]DeliveryReceipt, error) {420 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)419 func (db *PostgresDB) ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error) { 420 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 421 421 defer cancel() 422 422 … … 445 445 } 446 446 447 func (db *PostgresDB) StoreClientDeliveryReceipts( networkID int64, client string, receipts []DeliveryReceipt) error {448 ctx, cancel := context.WithTimeout(c ontext.TODO(), postgresQueryTimeout)447 func (db *PostgresDB) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error { 448 ctx, cancel := context.WithTimeout(ctx, postgresQueryTimeout) 449 449 defer cancel() 450 450
Note:
See TracChangeset
for help on using the changeset viewer.