mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-23 07:51:14 +01:00
Make more syscalls async
This commit is contained in:
parent
6b33318f27
commit
a0bd11b142
@ -71,6 +71,7 @@ use Throwable;
|
|||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
use function Amp\async;
|
use function Amp\async;
|
||||||
|
use function Amp\File\deleteFile;
|
||||||
use function Amp\File\getSize;
|
use function Amp\File\getSize;
|
||||||
use function Amp\Future\await;
|
use function Amp\Future\await;
|
||||||
|
|
||||||
@ -1777,7 +1778,7 @@ final class MTProto implements TLCallback, LoggerGetter
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
\unlink($path);
|
deleteFile($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sent = false;
|
$sent = false;
|
||||||
|
@ -851,7 +851,9 @@ trait Files
|
|||||||
$this->downloadToStream($messageMedia, $stream, $cb, $size, -1);
|
$this->downloadToStream($messageMedia, $stream, $cb, $size, -1);
|
||||||
} finally {
|
} finally {
|
||||||
$unlock();
|
$unlock();
|
||||||
|
try {
|
||||||
deleteFile("$file.lock");
|
deleteFile("$file.lock");
|
||||||
|
} catch (Throwable) {}
|
||||||
$stream->close();
|
$stream->close();
|
||||||
}
|
}
|
||||||
return $file;
|
return $file;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user