Skip to content

Commit da229de

Browse files
committed
Improve Tinybird service initialization checks
1 parent 29e424c commit da229de

File tree

1 file changed

+4
-7
lines changed
  • packages/web-backend/src/Tinybird

1 file changed

+4
-7
lines changed

packages/web-backend/src/Tinybird/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,17 @@ export class Tinybird extends Effect.Service<Tinybird>()("Tinybird", {
3131
const token = env.TINYBIRD_TOKEN;
3232
const host = env.TINYBIRD_HOST;
3333

34-
if (!host) {
35-
yield* Effect.die(new Error("TINYBIRD_HOST must be set"));
36-
}
34+
const enabled = Boolean(token && host);
3735

3836
yield* Effect.logDebug("Initializing Tinybird service", {
3937
hasToken: Boolean(token),
40-
host,
38+
hasHost: Boolean(host),
39+
enabled,
4140
});
4241

43-
const enabled = Boolean(token);
44-
4542
if (!enabled) {
4643
yield* Effect.logWarning(
47-
"Tinybird is disabled: TINYBIRD_TOKEN is not set",
44+
"Tinybird is disabled: TINYBIRD_TOKEN and/or TINYBIRD_HOST not set",
4845
);
4946
}
5047

0 commit comments

Comments
 (0)