@staff0rd/assist 0.1143.0 → 0.1143.1
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/dist/index.js
CHANGED
|
@@ -10,6 +10,6 @@ if (isStatusLineInvocation(process.argv)) {
|
|
|
10
10
|
const { runStatusLine } = await import("./runStatusLine-6VBMFNUZ.js");
|
|
11
11
|
await runStatusLine();
|
|
12
12
|
} else {
|
|
13
|
-
const { runCli } = await import("./runCli-
|
|
13
|
+
const { runCli } = await import("./runCli-OSXLT6CQ.js");
|
|
14
14
|
await runCli();
|
|
15
15
|
}
|
|
@@ -16,7 +16,7 @@ import { Command } from "commander";
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "@staff0rd/assist",
|
|
19
|
-
version: "0.1143.
|
|
19
|
+
version: "0.1143.1",
|
|
20
20
|
type: "module",
|
|
21
21
|
main: "dist/index.js",
|
|
22
22
|
bin: {
|
|
@@ -3131,9 +3131,6 @@ async function ensureMigrated(orm, dir, origin) {
|
|
|
3131
3131
|
await migrateLocalBacklog(orm, dir, origin);
|
|
3132
3132
|
}
|
|
3133
3133
|
|
|
3134
|
-
// src/shared/db/getDb.ts
|
|
3135
|
-
import { Pool } from "pg";
|
|
3136
|
-
|
|
3137
3134
|
// src/commands/backlog/addFeed.ts
|
|
3138
3135
|
async function addFeed(db, url) {
|
|
3139
3136
|
const inserted = await db.insert(feeds).values({ url }).onConflictDoNothing({ target: feeds.url }).returning({ id: feeds.id });
|
|
@@ -3778,6 +3775,9 @@ function pgExecutor(queryable) {
|
|
|
3778
3775
|
};
|
|
3779
3776
|
}
|
|
3780
3777
|
|
|
3778
|
+
// src/shared/db/createPool.ts
|
|
3779
|
+
import { Pool } from "pg";
|
|
3780
|
+
|
|
3781
3781
|
// src/shared/db/MissingDatabaseUrlError.ts
|
|
3782
3782
|
var DATABASE_URL_ENV = "ASSIST_DATABASE_URL";
|
|
3783
3783
|
var MISSING_URL_MESSAGE = `No assist database configured.
|
|
@@ -3805,21 +3805,17 @@ function getDatabaseUrl() {
|
|
|
3805
3805
|
return url;
|
|
3806
3806
|
}
|
|
3807
3807
|
|
|
3808
|
-
// src/shared/db/
|
|
3809
|
-
async function runUsagePeakCleanup(orm) {
|
|
3810
|
-
try {
|
|
3811
|
-
await cleanupFalseResetSegments(orm);
|
|
3812
|
-
} catch (error) {
|
|
3813
|
-
console.error(
|
|
3814
|
-
`${(/* @__PURE__ */ new Date()).toISOString()} usage-peaks cleanup failed: ${String(error)}`
|
|
3815
|
-
);
|
|
3816
|
-
}
|
|
3817
|
-
}
|
|
3808
|
+
// src/shared/db/createPool.ts
|
|
3818
3809
|
function logPoolError(error) {
|
|
3819
3810
|
console.error(
|
|
3820
3811
|
`${(/* @__PURE__ */ new Date()).toISOString()} backlog pool error: ${error.message}`
|
|
3821
3812
|
);
|
|
3822
3813
|
}
|
|
3814
|
+
function logClientError(error) {
|
|
3815
|
+
console.error(
|
|
3816
|
+
`${(/* @__PURE__ */ new Date()).toISOString()} backlog client error: ${error.message}`
|
|
3817
|
+
);
|
|
3818
|
+
}
|
|
3823
3819
|
function createPool() {
|
|
3824
3820
|
const pool = new Pool({
|
|
3825
3821
|
connectionString: getDatabaseUrl(),
|
|
@@ -3830,8 +3826,24 @@ function createPool() {
|
|
|
3830
3826
|
connectionTimeoutMillis: 1e4
|
|
3831
3827
|
});
|
|
3832
3828
|
pool.on("error", logPoolError);
|
|
3829
|
+
pool.on("acquire", (client) => client.on("error", logClientError));
|
|
3830
|
+
pool.on(
|
|
3831
|
+
"release",
|
|
3832
|
+
(_error, client) => client.removeListener("error", logClientError)
|
|
3833
|
+
);
|
|
3833
3834
|
return pool;
|
|
3834
3835
|
}
|
|
3836
|
+
|
|
3837
|
+
// src/shared/db/getDb.ts
|
|
3838
|
+
async function runUsagePeakCleanup(orm) {
|
|
3839
|
+
try {
|
|
3840
|
+
await cleanupFalseResetSegments(orm);
|
|
3841
|
+
} catch (error) {
|
|
3842
|
+
console.error(
|
|
3843
|
+
`${(/* @__PURE__ */ new Date()).toISOString()} usage-peaks cleanup failed: ${String(error)}`
|
|
3844
|
+
);
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3835
3847
|
async function initDb(pool) {
|
|
3836
3848
|
try {
|
|
3837
3849
|
await assertMigrationsInSync(pgExecutor(pool));
|