We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 644c1ef commit dbfca1bCopy full SHA for dbfca1b
apps/webapp/app/v3/services/pauseEnvironment.server.ts
@@ -27,6 +27,25 @@ export class PauseEnvironmentService extends WithRunEngine {
27
action: PauseStatus
28
): Promise<PauseEnvironmentResult> {
29
try {
30
+ const org = await this._prisma.organization.findFirst({
31
+ where: {
32
+ id: environment.organizationId,
33
+ },
34
+ select: {
35
+ runsEnabled: true,
36
37
+ });
38
+
39
+ if (!org) {
40
+ throw new Error("Organization not found");
41
+ }
42
43
+ if (!org.runsEnabled && action === "resumed") {
44
+ throw new Error(
45
+ "Runs are disabled for this organization. Your free plan has probably been exceeded. If not please contact support."
46
+ );
47
48
49
await this._prisma.runtimeEnvironment.update({
50
where: {
51
id: environment.id,
0 commit comments