Skip to content

Commit d951f72

Browse files
authored
Merge branch 'main' into main
2 parents 5c643a8 + 74c2076 commit d951f72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+965
-288
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
commit: "chore: Update version for release"
7070
title: "chore: Update version for release"
7171
publish: pnpm run changeset:release
72-
createGithubReleases: false
72+
createGithubReleases: true
7373
env:
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

apps/webapp/app/env.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ const EnvironmentSchema = z.object({
177177

178178
LOOPS_API_KEY: z.string().optional(),
179179
MARQS_DISABLE_REBALANCING: z.coerce.boolean().default(false),
180+
MARQS_VISIBILITY_TIMEOUT_MS: z.coerce
181+
.number()
182+
.int()
183+
.default(60 * 1000 * 15),
184+
PROD_TASK_HEARTBEAT_INTERVAL_MS: z.coerce.number().int().optional(),
180185

181186
VERBOSE_GRAPHILE_LOGGING: z.string().default("false"),
182187
V2_MARQS_ENABLED: z.string().default("0"),

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ function ConnectedDevWarning() {
11551155
<Paragraph variant="small">
11561156
Runs usually start within 2 seconds in{" "}
11571157
<EnvironmentLabel environment={{ type: "DEVELOPMENT" }} />. Check you're running the
1158-
CLI: <InlineCode className="whitespace-nowrap">npx trigger.dev@beta dev</InlineCode>
1158+
CLI: <InlineCode className="whitespace-nowrap">npx trigger.dev@latest dev</InlineCode>
11591159
</Paragraph>
11601160
</div>
11611161
</Callout>

apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,15 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
798798
]);
799799
}
800800

801+
if (env.PROD_TASK_HEARTBEAT_INTERVAL_MS) {
802+
result = result.concat([
803+
{
804+
key: "HEARTBEAT_INTERVAL_MS",
805+
value: String(env.PROD_TASK_HEARTBEAT_INTERVAL_MS),
806+
},
807+
]);
808+
}
809+
801810
const commonVariables = await resolveCommonBuiltInVariables(runtimeEnvironment);
802811

803812
return [...result, ...commonVariables];

apps/webapp/app/v3/marqs/devQueueConsumer.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export class DevQueueConsumer {
162162
/**
163163
* @deprecated Use `taskRunHeartbeat` instead
164164
*/
165-
public async taskHeartbeat(workerId: string, id: string, seconds: number = 60) {
166-
logger.debug("[DevQueueConsumer] taskHeartbeat()", { id, seconds });
165+
public async taskHeartbeat(workerId: string, id: string) {
166+
logger.debug("[DevQueueConsumer] taskHeartbeat()", { id });
167167

168168
const taskRunAttempt = await prisma.taskRunAttempt.findUnique({
169169
where: { friendlyId: id },
@@ -173,13 +173,13 @@ export class DevQueueConsumer {
173173
return;
174174
}
175175

176-
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId, seconds);
176+
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId);
177177
}
178178

179-
public async taskRunHeartbeat(workerId: string, id: string, seconds: number = 60) {
180-
logger.debug("[DevQueueConsumer] taskRunHeartbeat()", { id, seconds });
179+
public async taskRunHeartbeat(workerId: string, id: string) {
180+
logger.debug("[DevQueueConsumer] taskRunHeartbeat()", { id });
181181

182-
await marqs?.heartbeatMessage(id, seconds);
182+
await marqs?.heartbeatMessage(id);
183183
}
184184

185185
public async stop(reason: string = "CLI disconnected") {

apps/webapp/app/v3/marqs/index.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ export class MarQS {
698698
}
699699

700700
// This should increment by the number of seconds, but with a max value of Date.now() + visibilityTimeoutInMs
701-
public async heartbeatMessage(messageId: string, seconds: number = 30) {
702-
await this.options.visibilityTimeoutStrategy.heartbeat(messageId, seconds * 1000);
701+
public async heartbeatMessage(messageId: string) {
702+
await this.options.visibilityTimeoutStrategy.heartbeat(messageId, this.visibilityTimeoutInMs);
703703
}
704704

705705
get visibilityTimeoutInMs() {
@@ -1871,7 +1871,7 @@ function getMarQSClient() {
18711871
redis: redisOptions,
18721872
defaultEnvConcurrency: env.DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT,
18731873
defaultOrgConcurrency: env.DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT,
1874-
visibilityTimeoutInMs: 120 * 1000, // 2 minutes,
1874+
visibilityTimeoutInMs: env.MARQS_VISIBILITY_TIMEOUT_MS,
18751875
enableRebalancing: !env.MARQS_DISABLE_REBALANCING,
18761876
subscriber: concurrencyTracker,
18771877
});

apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,8 +1169,8 @@ class SharedQueueTasks {
11691169
} satisfies TaskRunExecutionLazyAttemptPayload;
11701170
}
11711171

1172-
async taskHeartbeat(attemptFriendlyId: string, seconds: number = 60) {
1173-
logger.debug("[SharedQueueConsumer] taskHeartbeat()", { id: attemptFriendlyId, seconds });
1172+
async taskHeartbeat(attemptFriendlyId: string) {
1173+
logger.debug("[SharedQueueConsumer] taskHeartbeat()", { id: attemptFriendlyId });
11741174

11751175
const taskRunAttempt = await prisma.taskRunAttempt.findUnique({
11761176
where: { friendlyId: attemptFriendlyId },
@@ -1180,13 +1180,13 @@ class SharedQueueTasks {
11801180
return;
11811181
}
11821182

1183-
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId, seconds);
1183+
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId);
11841184
}
11851185

1186-
async taskRunHeartbeat(runId: string, seconds: number = 60) {
1187-
logger.debug("[SharedQueueConsumer] taskRunHeartbeat()", { runId, seconds });
1186+
async taskRunHeartbeat(runId: string) {
1187+
logger.debug("[SharedQueueConsumer] taskRunHeartbeat()", { runId });
11881188

1189-
await marqs?.heartbeatMessage(runId, seconds);
1189+
await marqs?.heartbeatMessage(runId);
11901190
}
11911191

11921192
public async taskRunFailed(completion: TaskRunFailedExecutionResult) {

docs/cli-deploy-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CLI deploy options"
3-
sidebarTitle: "Deploy"
3+
sidebarTitle: "deploy"
44
description: "Use these options to help deploy your tasks to Trigger.dev."
55
---
66

docs/cli-deploy.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: "CLI deploy command"
33
description: "The `trigger.dev deploy` command can be used to manually deploy."
44
---
55

6-
import ComingSoon from '/snippets/coming-soon-generic.mdx';
76
import CliDeployCommands from '/snippets/cli-commands-deploy.mdx';
87

98
<CliDeployCommands/>
10-
11-
{/* todo add options, remove the reference docs */}

docs/cli-dev-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CLI dev command"
3-
sidebarTitle: "Dev"
3+
sidebarTitle: "dev"
44
description: "The `trigger.dev dev` command is used to run your tasks locally."
55
---
66

0 commit comments

Comments
 (0)