fix
This commit is contained in:
parent
5e549b92e7
commit
99bee52238
@ -44,7 +44,7 @@ class MTProto extends \Volatile
|
||||
use \danog\MadelineProto\Wrappers\DialogHandler;
|
||||
use \danog\MadelineProto\Wrappers\Login;
|
||||
|
||||
const V = 65;
|
||||
const V = 66;
|
||||
|
||||
const NOT_LOGGED_IN = 0;
|
||||
const WAITING_CODE = 1;
|
||||
|
@ -28,14 +28,14 @@ class Serialization
|
||||
*/
|
||||
public static function serialize($filename, $instance, $force = false)
|
||||
{
|
||||
if (!file_exists($lock = '.'.$filename.'.lock')) {
|
||||
if (!file_exists($lock = $filename.'.lock')) {
|
||||
touch($lock);
|
||||
clearstatcache();
|
||||
}
|
||||
$lock = fopen($lock, 'r');
|
||||
flock($lock, LOCK_EX);
|
||||
$wrote = file_put_contents('.'.$filename, \danog\Serialization::serialize($instance, true));
|
||||
rename('.'.$filename, $filename);
|
||||
$wrote = file_put_contents($filename.'.temp.session', \danog\Serialization::serialize($instance, true));
|
||||
rename($filename.'.temp.session', $filename);
|
||||
flock($lock, LOCK_UN);
|
||||
fclose($lock);
|
||||
|
||||
@ -55,7 +55,7 @@ class Serialization
|
||||
{
|
||||
set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']);
|
||||
if (file_exists($filename)) {
|
||||
if (!file_exists($lock = '.'.$filename.'.lock')) {
|
||||
if (!file_exists($lock = $filename.'.lock')) {
|
||||
touch($lock);
|
||||
clearstatcache();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user