chore: delete file async
parent
2bc247f3df
commit
3f79a28bc1
|
@ -50,13 +50,15 @@ namespace LeanCloud.Storage.Internal.Storage {
|
|||
return null;
|
||||
}
|
||||
|
||||
public void Delete(string filename) {
|
||||
public Task Delete(string filename) {
|
||||
if (storage == null) {
|
||||
return;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
string path = GetFileFullPath(filename);
|
||||
IOFile.Delete(path);
|
||||
return Task.Run(() => {
|
||||
IOFile.Delete(path);
|
||||
});
|
||||
}
|
||||
|
||||
private string GetFileFullPath(string filename) {
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace LeanCloud.Storage {
|
|||
currentUser = ParseObject(data) as LCUser;
|
||||
} catch (Exception e) {
|
||||
LCLogger.Error(e);
|
||||
LCInternalApplication.StorageController.Delete(USER_DATA);
|
||||
await LCInternalApplication.StorageController.Delete(USER_DATA);
|
||||
}
|
||||
}
|
||||
return currentUser;
|
||||
|
@ -513,8 +513,7 @@ namespace LeanCloud.Storage {
|
|||
public static Task Logout() {
|
||||
currentUser = null;
|
||||
// 清理持久化数据
|
||||
LCInternalApplication.StorageController.Delete(USER_DATA);
|
||||
return Task.FromResult<object>(null);
|
||||
return LCInternalApplication.StorageController.Delete(USER_DATA);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue