Skip to content

Commit 9d5b138

Browse files
committed
chore: Update release.yml and remove unused imports in AppService
1 parent adf0830 commit 9d5b138

File tree

2 files changed

+38
-33
lines changed

2 files changed

+38
-33
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
mkdir -p .debpkg/usr/bin
127127
cp sesame-daemon-linux .debpkg/usr/bin/sesame-daemon
128128
mkdir -p .debpkg/var/lib/sesame-daemon/backends
129-
cp -r ./backends.example .debpkg/var/lib/sesame-daemon/backends
129+
cp -r ./backends.example .debpkg/var/lib/sesame-daemon
130130
chmod +x .debpkg/DEBIAN/postinst
131131
chmod +x .debpkg/DEBIAN/postrm
132132

src/_common/tasks/executor.task.ts

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,44 @@ export async function executorTask(
1313
const jobDataArg = JSON.stringify(job.data);
1414
// const escapedJobDataArg = `'${jobDataArg.replace(/'/g, "'\\''")}'`;
1515

16-
const child = spawn(join(command), {
17-
shell: options?.shell ?? true,
18-
// stdio: 'pipe',
19-
});
20-
21-
child.stdin.write(jobDataArg);
22-
child.stdin.end();
23-
24-
let outputChunk = '';
25-
let errorChunk = '';
26-
27-
child.stdout.on('data', (data) => {
28-
console.log(`stdout: ${data}`);
29-
outputChunk += data;
30-
});
31-
32-
child.stderr.on('data', (data) => {
33-
console.error(`stderr: ${data}`);
34-
errorChunk += data;
35-
});
36-
37-
child.on('close', (code) => {
38-
console.log(`Le processus enfant s'est terminé avec le code ${code}`);
39-
resolve({
40-
status: code,
41-
output: outputChunk?.toString(),
42-
error: errorChunk?.toString(),
16+
try {
17+
const child = spawn(join(command), {
18+
shell: options?.shell ?? true,
19+
stdio: 'pipe',
4320
});
44-
});
4521

46-
child.on('error', (spawnError) => {
47-
console.error('Erreur lors du lancement du processus enfant', spawnError);
48-
reject(spawnError);
49-
});
22+
child.stdin.write(jobDataArg);
23+
child.stdin.end();
24+
25+
let outputChunk = '';
26+
let errorChunk = '';
27+
28+
child.stdout.on('data', (data) => {
29+
console.log(`stdout: ${data}`);
30+
outputChunk += data;
31+
});
32+
33+
child.stderr.on('data', (data) => {
34+
console.error(`stderr: ${data}`);
35+
errorChunk += data;
36+
});
37+
38+
child.on('close', (code) => {
39+
console.log(`Le processus enfant s'est terminé avec le code ${code}`);
40+
resolve({
41+
status: code,
42+
output: outputChunk?.toString(),
43+
error: errorChunk?.toString(),
44+
});
45+
});
46+
47+
child.on('error', (spawnError) => {
48+
console.error('Erreur lors du lancement du processus enfant', spawnError);
49+
reject(spawnError);
50+
});
51+
} catch (error) {
52+
console.error('Erreur lors de l\'exécution de la tâche', error);
53+
reject(error);
54+
}
5055
});
5156
}

0 commit comments

Comments
 (0)