Catch `ProcessLookupError` in `BorgJob.cancel`. (#1520)

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
This commit is contained in:
yfprojects 2022-12-25 16:52:24 +00:00 committed by GitHub
parent 225e84f115
commit 7e7abafb3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,10 @@ class BorgJob(JobInterface, BackupProfileMixin):
try:
self.process.wait(timeout=3)
except TimeoutExpired:
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
try:
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
except ProcessLookupError:
pass
@classmethod
def prepare(cls, profile):