feat: Add 'bd stale' command to show and release orphaned executor claims
- Implements bd stale command to show issues with execution_state where executor is dead/stopped - Adds --release flag to automatically release orphaned issues - Adds --threshold flag to customize heartbeat staleness threshold (default: 300s/5min) - Handles missing executor instances (LEFT JOIN) for cases where executor was deleted - Adds QueryContext and BeginTx helper methods to SQLiteStorage for advanced queries - Fixes ExternalRef comparison bug in import_shared.go (pointer vs string) - Removes unused imports in import.go Resolves vc-124
This commit is contained in:
18
internal/storage/sqlite/util.go
Normal file
18
internal/storage/sqlite/util.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
// QueryContext exposes the underlying database QueryContext method for advanced queries
|
||||
// This is used by commands that need direct SQL access (e.g., bd stale)
|
||||
func (s *SQLiteStorage) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) {
|
||||
return s.db.QueryContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
// BeginTx starts a new database transaction
|
||||
// This is used by commands that need to perform multiple operations atomically
|
||||
func (s *SQLiteStorage) BeginTx(ctx context.Context) (*sql.Tx, error) {
|
||||
return s.db.BeginTx(ctx, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user