fix(valkey,tasks): prevent unhandled connection hangs in sandbox and constrain test directives
This commit is contained in:
parent
a82136fc95
commit
f5bafbca78
@ -6,8 +6,21 @@ const VALKEY_URL = Deno.env.get("VALKEY_URL") ||
|
||||
export const valkey = VALKEY_URL
|
||||
? new Redis(VALKEY_URL, {
|
||||
enableOfflineQueue: false,
|
||||
maxRetriesPerRequest: 1,
|
||||
retryStrategy: (times) => (times > 3 ? null : Math.min(times * 100, 1000)),
|
||||
})
|
||||
: new Redis({ lazyConnect: true, enableOfflineQueue: false });
|
||||
: new Redis({
|
||||
lazyConnect: true,
|
||||
enableOfflineQueue: false,
|
||||
maxRetriesPerRequest: 1,
|
||||
retryStrategy: () => null,
|
||||
});
|
||||
|
||||
valkey.on("error", (err) => {
|
||||
if (Deno.env.get("DEBUG_VALKEY")) {
|
||||
console.warn("[Valkey] Connection warning:", err.message);
|
||||
}
|
||||
});
|
||||
|
||||
export async function pingValkey(): Promise<void> {
|
||||
if (!VALKEY_URL) return; // Skip in test
|
||||
|
||||
@ -47,7 +47,8 @@ in an existing task file._
|
||||
2. Apply minimal, pure functional modifications.
|
||||
3. Ensure all downstream pipeline steps and context contracts remain intact.
|
||||
4. Run all quality gates (`deno fmt`, `deno task lint`, `deno task check`, `deno task test`).
|
||||
5. Upon successful completion and verification, update the task status according to `tasks/GUIDELINES.md`.
|
||||
5. Run ONLY unit tests (`deno task test` / `deno test --allow-all`). Do NOT execute `deno task start` or `deno task dev` (live database daemons are not running in sandbox containers).
|
||||
6. Upon successful completion and verification, update the task status according to `tasks/GUIDELINES.md`.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user