diff --git a/frontend/providers/template/src/pages/api/updateRepo.ts b/frontend/providers/template/src/pages/api/updateRepo.ts index 1b0834720..ea8eb7939 100644 --- a/frontend/providers/template/src/pages/api/updateRepo.ts +++ b/frontend/providers/template/src/pages/api/updateRepo.ts @@ -74,17 +74,20 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< const branch = process.env.TEMPLATE_REPO_BRANCH || 'main'; try { - execAsync('git config --global --add safe.directory /app/providers/template/templates'); - const timeoutPromise = new Promise((resolve, reject) => { - setTimeout(() => { - reject(new Error('operation timed out')); - }, 60 * 1000); - }); - const gitOperationPromise = !fs.existsSync(targetPath) - ? execAsync(`git clone -b ${branch} ${repoHttpUrl} ${targetPath} --depth=1`) - : execAsync(`cd ${targetPath} && git pull --depth=1 --rebase`); + const gitConfigResult = await execAsync( + 'git config --global --add safe.directory /app/providers/template/templates', + { timeout: 10000 } + ); - await Promise.race([gitOperationPromise, timeoutPromise]); + console.log('git config:', gitConfigResult); + + const gitCommand = !fs.existsSync(targetPath) + ? `git clone -b ${branch} ${repoHttpUrl} ${targetPath} --depth=1` + : `cd ${targetPath} && git pull --depth=1 --rebase`; + + const result = await execAsync(gitCommand, { timeout: 60000 }); + + console.log('git operation:', result); } catch (error) { console.log('git operation timed out: \n', error); } diff --git a/frontend/providers/template/src/pages/deploy/components/Form.tsx b/frontend/providers/template/src/pages/deploy/components/Form.tsx index 70b236897..aa9cdd11b 100644 --- a/frontend/providers/template/src/pages/deploy/components/Form.tsx +++ b/frontend/providers/template/src/pages/deploy/components/Form.tsx @@ -103,6 +103,8 @@ const Form = ({ className="template-dynamic-label" color={'#333'} userSelect={'none'} + whiteSpace={'pre-wrap'} + wordBreak={'break-word'} > {item?.label} {item?.required && (