improve copilot + fix minor bugs
This commit is contained in:
@ -19,7 +19,7 @@ export default {
|
||||
{
|
||||
role: "system",
|
||||
content:
|
||||
"You are an expert coding assistant. You read code from a file, and you suggest new code to add to the file. You may be given instructions on what to generate, which you should follow. You should generate code that is correct, efficient, and follows best practices. You should also generate code that is clear and easy to read. When you generate code, you should only return the code, and nothing else. You should not include backticks in the code you generate.",
|
||||
"You are an expert coding assistant. You read code from a file, and you suggest new code to add to the file. You may be given instructions on what to generate, which you should follow. You should generate code that is CORRECT, efficient, and follows best practices. You may generate multiple lines of code if necessary. When you generate code, you should ONLY return the code, and nothing else. You MUST NOT include backticks in the code you generate.",
|
||||
},
|
||||
{
|
||||
role: "user",
|
||||
|
@ -17,8 +17,6 @@ import {
|
||||
getSandboxFiles,
|
||||
renameFile,
|
||||
saveFile,
|
||||
stopServer,
|
||||
testDescribe,
|
||||
} from "./utils";
|
||||
import { IDisposable, IPty, spawn } from "node-pty";
|
||||
import {
|
||||
@ -453,24 +451,22 @@ io.on("connection", async (socket) => {
|
||||
);
|
||||
}
|
||||
|
||||
const sockets = await io.fetchSockets();
|
||||
if (inactivityTimeout) {
|
||||
clearTimeout(inactivityTimeout);
|
||||
}
|
||||
if (sockets.length === 0) {
|
||||
console.log("STARTING TIMER");
|
||||
inactivityTimeout = setTimeout(() => {
|
||||
io.fetchSockets().then(async (sockets) => {
|
||||
if (sockets.length === 0) {
|
||||
console.log("Closing server due to inactivity.");
|
||||
const res = await stopServer(data.sandboxId);
|
||||
console.log("Server stopped", res);
|
||||
}
|
||||
});
|
||||
}, 20000);
|
||||
} else {
|
||||
console.log("number of sockets", sockets.length);
|
||||
}
|
||||
// const sockets = await io.fetchSockets();
|
||||
// if (inactivityTimeout) {
|
||||
// clearTimeout(inactivityTimeout);
|
||||
// }
|
||||
// if (sockets.length === 0) {
|
||||
// console.log("STARTING TIMER");
|
||||
// inactivityTimeout = setTimeout(() => {
|
||||
// io.fetchSockets().then(async (sockets) => {
|
||||
// if (sockets.length === 0) {
|
||||
// console.log("Server stopped", res);
|
||||
// }
|
||||
// });
|
||||
// }, 20000);
|
||||
// } else {
|
||||
// console.log("number of sockets", sockets.length);
|
||||
// }
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user