mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
utils.image: stop shitting up /tmp
This commit is contained in:
parent
041dcc6ed0
commit
735f125d9c
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ import contextlib
|
||||||
import functools
|
import functools
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
|
@ -122,7 +123,7 @@ async def process_image_in_subprocess(command_name, image_data: bytes):
|
||||||
try:
|
try:
|
||||||
image_data, err = await asyncio.wait_for(proc.communicate(image_data), timeout=float('inf'))
|
image_data, err = await asyncio.wait_for(proc.communicate(image_data), timeout=float('inf'))
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
proc.kill()
|
proc.send_signal(signal.SIGINT)
|
||||||
raise errors.ImageResizeTimeoutError if command_name == 'resize' else errors.ImageConversionTimeoutError
|
raise errors.ImageResizeTimeoutError if command_name == 'resize' else errors.ImageConversionTimeoutError
|
||||||
else:
|
else:
|
||||||
if proc.returncode == 2:
|
if proc.returncode == 2:
|
||||||
|
|
Loading…
Reference in a new issue