fix: TypeScript errors + workflow pipeline ordering
- Fix hls! null assertions in error handler (TS18047) - Fix test mock type errors: remove unused errorCall, use (as any) cast - Pipeline ordering: CD + Pages deploy now run after CI completes (workflow_run: [CI]) - Add GOFLAGS=-mod=mod to playout Docker build for new fsnotify dep
This commit is contained in:
1 parent
18459a9811
commit
9178b7b295
5 files changed
+15
-15
No files matched your search
@@ -6,12 +6,14 @@
|
|||||||
name: CD
|
name: CD
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_run:
|
||||||
branches: [main]
|
workflows: [CI]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
name: Deploy to Cloudflare Pages
|
name: Deploy to Cloudflare Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_run:
|
||||||
branches: ["main"]
|
workflows: [CI]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ COPY src/go.mod src/go.sum ./
|
|||||||
|
|
||||||
# Download dependencies and build
|
# Download dependencies and build
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /playlist-manager ./src/playlist.go
|
RUN CGO_ENABLED=0 GOOS=linux GOFLAGS=-mod=mod go build -o /playlist-manager ./src/playlist.go
|
||||||
|
|
||||||
FROM alpine:3.20
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
|||||||
@@ -353,13 +353,9 @@ describe("player error recovery", () => {
|
|||||||
await main.initPlayerAndChat(async () => ({ default: HlsMock }) as any);
|
await main.initPlayerAndChat(async () => ({ default: HlsMock }) as any);
|
||||||
|
|
||||||
// Find the error handler registered by initPlayerAndChat
|
// Find the error handler registered by initPlayerAndChat
|
||||||
const errorCall = HlsMock.mock.results?.[0]?.value?.on?.mock?.calls?.find(
|
const errorHandler = (hlsInstance.on as any).mock.calls.find(
|
||||||
(c: [string, Function]) => c[0] === "hlsError"
|
(c: any) => c[0] === "hlsError"
|
||||||
);
|
) as [string, Function] | undefined;
|
||||||
// Use hlsInstance.on mock calls
|
|
||||||
const errorHandler = hlsInstance.on.mock.calls.find(
|
|
||||||
(c: [string, Function]) => c[0] === "hlsError"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (errorHandler) {
|
if (errorHandler) {
|
||||||
const handler = errorHandler[1];
|
const handler = errorHandler[1];
|
||||||
|
|||||||
@@ -198,17 +198,17 @@ export async function initPlayerAndChat(loadHlsModule: () => Promise<{ default:
|
|||||||
if (playerErrorCount <= 1) {
|
if (playerErrorCount <= 1) {
|
||||||
console.warn("HLS media error, attempting recovery...");
|
console.warn("HLS media error, attempting recovery...");
|
||||||
showReconnecting("Recovering...");
|
showReconnecting("Recovering...");
|
||||||
hls.recoverMediaError();
|
hls!.recoverMediaError();
|
||||||
} else {
|
} else {
|
||||||
console.error("HLS media error: recovery failed");
|
console.error("HLS media error: recovery failed");
|
||||||
hls.destroy();
|
hls!.destroy();
|
||||||
showReconnecting("Stream temporarily unavailable");
|
showReconnecting("Stream temporarily unavailable");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.error("HLS fatal error:", data.type, data.details);
|
console.error("HLS fatal error:", data.type, data.details);
|
||||||
hls.destroy();
|
hls!.destroy();
|
||||||
showReconnecting("Stream temporarily unavailable");
|
showReconnecting("Stream temporarily unavailable");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user