Skip to content

Commit

Permalink
analizators/s1854
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhorukovAnton committed Jan 21, 2022
1 parent 2f5a70e commit f3d8b8d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
2 changes: 0 additions & 2 deletions common/services/ASC.ElasticSearch/Engine/BaseIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ internal async Task IndexAsync(List<T> data, bool immediately = true)
{
wwd.Document.Data = null;
wwd.Document = null;
wwd = null;
GC.Collect();
}
continue;
Expand Down Expand Up @@ -288,7 +287,6 @@ internal async Task IndexAsync(List<T> data, bool immediately = true)
doc.Document.Data = null;
doc.Document = null;
}
doc = null;
}

portionStart = i;
Expand Down
7 changes: 1 addition & 6 deletions products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,13 @@ private async Task InternalBulkDownloadFile(HttpContext context, IDataStore stor
{
try
{
var flushed = false;
using (var readStream = store.GetReadStream(FileConstant.StorageDomainTmp, path))
{
long offset = 0;
var length = readStream.Length;
if (readStream.CanSeek)
{
length = ProcessRangeHeader(context, readStream.Length, ref offset);
readStream.Seek(offset, SeekOrigin.Begin);
}

flushed = await SendStreamByChunksAsync(context, length, FileConstant.DownloadTitle + ext, readStream, flushed);
}
}

await context.Response.Body.FlushAsync();
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/HttpHandlers/SearchHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public IEnumerable<Folder<int>> SearchFolders(string text)
//result = result.Concat(EntryManager.GetThirpartyFolders(folderMy, text));
}

id = GlobalFolderHelper.FolderCommon;
//id = GlobalFolderHelper.FolderCommon;
//var folderCommon = folderDao.GetFolder(id);
//result = result.Concat(EntryManager.GetThirpartyFolders(folderCommon, text));
}
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/Utils/EntryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public IEnumerable<FileEntry> GetEntries<T>(Folder<T> parent, int from, int coun
const string responseBody = null;// apiServer.GetApiResponse(apiUrl, "GET");
if (responseBody != null)
{
var responseApi = JObject.Parse(Encoding.UTF8.GetString(Convert.FromBase64String(responseBody)));
JObject responseApi;

Dictionary<int, KeyValuePair<int, string>> folderIDProjectTitle = null;

Expand Down
2 changes: 1 addition & 1 deletion web/ASC.Web.Api/Controllers/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3011,7 +3011,7 @@ private void CheckCache(string basekey)
throw new Exception(Resource.ErrorRequestLimitExceeded);
}

MemoryCache.Set(key, ++count, TimeSpan.FromMinutes(expirationMinutes));
MemoryCache.Set(key, count + 1, TimeSpan.FromMinutes(expirationMinutes));
}
}
}
4 changes: 2 additions & 2 deletions web/ASC.Web.Core/Notify/StudioPeriodicNotify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void SendSaasLetters(string senderName, DateTime scheduleDate)

Log.Info("Start SendSaasTariffLetters");

var activeTenants = new List<Tenant>();
List<Tenant> activeTenants;

using (var scope = ServiceProvider.CreateScope())
{
Expand Down Expand Up @@ -871,7 +871,7 @@ public void SendOpensourceLetters(string senderName, DateTime scheduleDate)

Log.Info("Start SendOpensourceTariffLetters");

var activeTenants = new List<Tenant>();
List<Tenant> activeTenants;

using (var scope = ServiceProvider.CreateScope())
{
Expand Down
2 changes: 1 addition & 1 deletion web/ASC.Web.Core/Sms/SmsKeyStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public Result ValidateKey(string phone, string key)
if (createDate.Add(StoreInterval) < DateTime.UtcNow)
return Result.Timeout;

CheckCache.Insert(cacheCheck, (--counter).ToString(CultureInfo.InvariantCulture), DateTime.UtcNow.Add(StoreInterval));
CheckCache.Insert(cacheCheck, (counter - 1).ToString(CultureInfo.InvariantCulture), DateTime.UtcNow.Add(StoreInterval));
return Result.Ok;
}
}
Expand Down
4 changes: 2 additions & 2 deletions web/ASC.Web.Core/Tfa/TfaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public bool ValidateAuthCode(UserInfo user, string code, bool checkBackup = true
}
}

Cache.Insert("tfa/" + user.ID, (--counter).ToString(CultureInfo.InvariantCulture), DateTime.UtcNow.Add(TimeSpan.FromMinutes(1)));
Cache.Insert("tfa/" + user.ID, (counter - 1).ToString(CultureInfo.InvariantCulture), DateTime.UtcNow.Add(TimeSpan.FromMinutes(1)));

if (!SecurityContext.IsAuthenticated)
{
Expand All @@ -179,7 +179,7 @@ public IEnumerable<BackupCode> GenerateBackupCodes()

const string alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_";

var data = new byte[length];
byte[] data;

var list = new List<BackupCode>();

Expand Down

0 comments on commit f3d8b8d

Please sign in to comment.