Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0742446199 |
@@ -297,20 +297,19 @@ func (c *Cache) LookupSource(
|
||||
|
||||
key := req.Source.Key()
|
||||
|
||||
var foundKey string
|
||||
var rowExists bool
|
||||
|
||||
err := c.db.QueryRowContext(ctx, `
|
||||
SELECT source_key FROM source_content WHERE source_key = ?
|
||||
`, string(key)).Scan(&foundKey)
|
||||
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
SELECT EXISTS(SELECT 1 FROM source_content WHERE source_key = ?)
|
||||
`, string(key)).Scan(&rowExists)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to lookup source: %w", err)
|
||||
}
|
||||
|
||||
if !rowExists {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Verify the content file exists
|
||||
if !c.srcContent.Exists(key) {
|
||||
return "", nil
|
||||
|
||||
Reference in new issue
Block a user