Update server.js
Browse files
server.js
CHANGED
|
@@ -159,18 +159,16 @@ app.get('/api/sandbox/:sandboxId/cmds/:cmdId/logs', (req, res) => {
|
|
| 159 |
res.end();
|
| 160 |
return;
|
| 161 |
}
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
}) + '
|
| 170 |
');
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
sandboxManager.addLogStream(sandboxId, cmdId, res);
|
| 175 |
|
| 176 |
const keepAlive = setInterval(() => {
|
|
|
|
| 159 |
res.end();
|
| 160 |
return;
|
| 161 |
}
|
| 162 |
+
if (command.logs && command.logs.length > 0) {
|
| 163 |
+
command.logs.forEach(log => {
|
| 164 |
+
res.write(JSON.stringify({
|
| 165 |
+
data: log.data,
|
| 166 |
+
stream: log.stream,
|
| 167 |
+
timestamp: log.timestamp
|
| 168 |
+
}) + '
|
|
|
|
| 169 |
');
|
| 170 |
+
});
|
| 171 |
+
}
|
|
|
|
| 172 |
sandboxManager.addLogStream(sandboxId, cmdId, res);
|
| 173 |
|
| 174 |
const keepAlive = setInterval(() => {
|