Skip to content

Commit e2cdbf3

Browse files
committed
Fixed fe interval
1 parent b779937 commit e2cdbf3

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

mobile-magic/apps/frontend/components/PreviewIframe.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export function PreviewIframe({ url }: { url: string }) {
66
const [isLoading, setIsLoading] = useState(true);
77

88
useEffect(() => {
9-
const timer = setTimeout(() => {
9+
console.log("interval started")
10+
const timer = setInterval(() => {
11+
console.log(`Checking if ${url} is ready`);
1012
fetch(url)
1113
.then(response => response.ok)
1214
.then(ok => {
@@ -17,11 +19,11 @@ export function PreviewIframe({ url }: { url: string }) {
1719
}
1820
})
1921
}, 1000);
20-
return () => clearTimeout(timer);
22+
return () => clearInterval(timer);
2123
}, [url]);
2224

2325
if (isLoading) {
24-
return <div className="w-full h-full rounded-lg flex items-center justify-center">Loading...</div>;
26+
return <div className="w-full h-full rounded-lg flex items-center justify-center"></div>;
2527
}
2628

2729
return (

mobile-magic/apps/frontend/hooks/usePrompts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function usePrompts(projectId: string) {
3434
});
3535
}
3636
getPrompts();
37-
let interval = setInterval(getPrompts, 1000);
37+
let interval = setInterval(getPrompts, 3 * 1000);
3838
return () => clearInterval(interval);
3939
}, []);
4040

mobile-magic/apps/k8s-orchestrator/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ async function createPod(name: string) {
6565
key: "ANTHROPIC_API_KEY",
6666
}
6767
}
68+
}, {
69+
name: "DATABASE_URL",
70+
valueFrom: {
71+
secretKeyRef: {
72+
name: "worker-secret",
73+
key: "DATABASE_URL",
74+
}
75+
}
6876
}]
6977
}],
7078
},

ops/app/k8s-orchestrator/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: k8s-orchestrator
18-
image: 100xdevs/antidevs-k8s-orchestrator:0fc85e24b1862b7a7a4fa021829ef785092735da
18+
image: 100xdevs/antidevs-k8s-orchestrator:b779937bdfda177a72b28a9a7b5757fe0d37b625
1919
ports:
2020
- containerPort: 7001
2121
env:

0 commit comments

Comments
 (0)