Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavez committed Aug 27, 2024
1 parent 7eeb36d commit 943496f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/uhttp/dbcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func NewDBCache(ctx context.Context, cfg CacheConfig) (*DBCache, error) {
// Connect to db
db, err := sql.Open("sqlite", filepath.Join(cacheDir, "lcache.db"))
if err != nil {
l.Debug("Failed to open SQLite database", zap.Error(err))
l.Debug("Failed to open database", zap.Error(err))
return &DBCache{}, err
}

// Create cache table
_, err = db.Exec("CREATE TABLE IF NOT EXISTS http_cache(id INTEGER PRIMARY KEY, key NVARCHAR, data BLOB, expiration INTEGER)")
if err != nil {
l.Debug("Failed to create cache table in SQLite database", zap.Error(err))
l.Debug("Failed to create cache table in database", zap.Error(err))
return &DBCache{}, err
}

Expand Down Expand Up @@ -231,7 +231,7 @@ func (d *DBCache) Has(ctx context.Context, key string) (bool, error) {
return false, nil
}

// IsNilConnection check if the database connection is nil
// IsNilConnection check if the database connection is nil.
func (d *DBCache) IsNilConnection() bool {
return d.db == nil
}
Expand Down

0 comments on commit 943496f

Please sign in to comment.