shellwise 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/db/queries.ts +6 -1
package/package.json
CHANGED
package/src/db/queries.ts
CHANGED
|
@@ -151,7 +151,12 @@ export function pruneOlderThan(days: number): number {
|
|
|
151
151
|
const db = getDb();
|
|
152
152
|
const cutoff = Date.now() - days * 24 * 3600_000;
|
|
153
153
|
|
|
154
|
-
const result = db.run(
|
|
154
|
+
const result = db.run(
|
|
155
|
+
`DELETE FROM commands WHERE command_hash IN (
|
|
156
|
+
SELECT command_hash FROM command_stats WHERE last_used_at < ?
|
|
157
|
+
)`,
|
|
158
|
+
[cutoff]
|
|
159
|
+
);
|
|
155
160
|
|
|
156
161
|
// Cleanup orphaned stats
|
|
157
162
|
db.run(
|