Files: removed temp
This commit is contained in:
parent
60562d69a3
commit
ae69a9559e
3
build/Jenkinsfile
vendored
3
build/Jenkinsfile
vendored
@ -2,7 +2,6 @@ pipeline {
|
||||
agent none
|
||||
stages {
|
||||
stage('Build') {
|
||||
when { expression { return false; } }
|
||||
parallel {
|
||||
stage('Unix') {
|
||||
agent { label 'net-core' }
|
||||
@ -63,7 +62,6 @@ pipeline {
|
||||
agent { label 'net-core' }
|
||||
stages {
|
||||
stage('Components') {
|
||||
when { expression { return false; } }
|
||||
steps {
|
||||
sh "sh ./build/scripts/components.sh && cd ${env.WORKSPACE}/web/ASC.Web.Components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
|
||||
}
|
||||
@ -93,7 +91,6 @@ pipeline {
|
||||
agent { label 'win-core' }
|
||||
stages {
|
||||
stage('Components') {
|
||||
when { expression { return false; } }
|
||||
steps {
|
||||
bat "sh build\\scripts\\components.sh && cd ${env.WORKSPACE}\\web\\ASC.Web.Components && yarn test:coverage --ci --reporters=default --reporters=jest-junit || true"
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ namespace ASC.Common.Caching
|
||||
[Singletone]
|
||||
public class AscCache : ICache
|
||||
{
|
||||
public IMemoryCache MemoryCache { get; }
|
||||
private IMemoryCache MemoryCache { get; }
|
||||
|
||||
public AscCache(IMemoryCache memoryCache)
|
||||
{
|
||||
|
@ -34,8 +34,6 @@ using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Caching;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace ASC.Common.Threading
|
||||
{
|
||||
[Singletone]
|
||||
@ -69,13 +67,11 @@ namespace ASC.Common.Threading
|
||||
|
||||
notifyCache.Subscribe((c) =>
|
||||
{
|
||||
TestContext.WriteLine($"HashSet remove key: {c}");
|
||||
Cache.HashSet(c.Key, c.Id, (DistributedTaskCache)null);
|
||||
}, CacheNotifyAction.Remove);
|
||||
|
||||
notifyCache.Subscribe((c) =>
|
||||
{
|
||||
TestContext.WriteLine($"HashSet key: {c}");
|
||||
Cache.HashSet(c.Key, c.Id, c);
|
||||
}, CacheNotifyAction.InsertOrUpdate);
|
||||
}
|
||||
@ -146,14 +142,9 @@ namespace ASC.Common.Threading
|
||||
|
||||
var cancelation = new CancellationTokenSource();
|
||||
var token = cancelation.Token;
|
||||
cancelations[distributedTask.Id] = cancelation;
|
||||
|
||||
TestContext.WriteLine($"ThreadId QueueTask: {Thread.CurrentThread.ManagedThreadId}");
|
||||
cancelations[distributedTask.Id] = cancelation;
|
||||
|
||||
var task = new Task(() => {
|
||||
TestContext.WriteLine($"ThreadId QueueTask task: {Thread.CurrentThread.ManagedThreadId}");
|
||||
action(distributedTask, token);
|
||||
}, token, TaskCreationOptions.LongRunning);
|
||||
var task = new Task(() => { action(distributedTask, token); }, token, TaskCreationOptions.LongRunning);
|
||||
task
|
||||
.ConfigureAwait(false)
|
||||
.GetAwaiter()
|
||||
@ -172,7 +163,6 @@ namespace ASC.Common.Threading
|
||||
|
||||
public IEnumerable<DistributedTask> GetTasks()
|
||||
{
|
||||
TestContext.WriteLine($"key: {key}");
|
||||
var tasks = cache.HashGetAll<DistributedTaskCache>(key).Select(r => new DistributedTask(r.Value)).ToList();
|
||||
tasks.ForEach(t =>
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace ASC.Core.Caching
|
||||
public const string REFS = "refs";
|
||||
|
||||
public TrustInterval TrustInterval { get; set; }
|
||||
public ICache Cache { get; }
|
||||
internal ICache Cache { get; }
|
||||
internal CoreBaseSettings CoreBaseSettings { get; }
|
||||
internal ICacheNotify<UserInfoCacheItem> CacheUserInfoItem { get; }
|
||||
internal ICacheNotify<UserPhotoCacheItem> CacheUserPhotoItem { get; }
|
||||
|
@ -36,9 +36,9 @@ namespace ASC.Data.Storage.Migration
|
||||
[Singletone]
|
||||
public class ServiceClientListener
|
||||
{
|
||||
public ICacheNotify<MigrationProgress> ProgressMigrationNotify { get; }
|
||||
public IServiceProvider ServiceProvider { get; }
|
||||
public ICache Cache { get; }
|
||||
private ICacheNotify<MigrationProgress> ProgressMigrationNotify { get; }
|
||||
private IServiceProvider ServiceProvider { get; }
|
||||
private ICache Cache { get; }
|
||||
|
||||
public ServiceClientListener(
|
||||
ICacheNotify<MigrationProgress> progressMigrationNotify,
|
||||
|
@ -43,7 +43,7 @@ namespace ASC.VoipService.Dao
|
||||
[Singletone]
|
||||
public class VoipDaoCache
|
||||
{
|
||||
public ICache Cache { get; }
|
||||
internal ICache Cache { get; }
|
||||
private ICacheNotify<CachedVoipItem> Notify { get; }
|
||||
|
||||
public VoipDaoCache(ICacheNotify<CachedVoipItem> notify, ICache cache)
|
||||
|
@ -61,6 +61,7 @@ namespace ASC.ApiSystem
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
services.AddHttpContextAccessor();
|
||||
services.AddMemoryCache();
|
||||
|
||||
services.AddControllers()
|
||||
.AddJsonOptions(options =>
|
||||
|
@ -49,7 +49,7 @@ namespace ASC.Data.Backup.Service
|
||||
public class BackupServiceNotifier
|
||||
{
|
||||
private ICacheNotify<BackupProgress> СacheBackupProgress { get; }
|
||||
public ICache Cache { get; }
|
||||
private ICache Cache { get; }
|
||||
|
||||
public BackupServiceNotifier(ICacheNotify<BackupProgress> сacheBackupProgress, ICache cache)
|
||||
{
|
||||
|
@ -44,9 +44,9 @@ namespace ASC.Data.Storage.Encryption
|
||||
private object Locker { get; }
|
||||
private FactoryOperation FactoryOperation { get; }
|
||||
|
||||
public EncryptionWorker(FactoryOperation factoryOperation)
|
||||
public EncryptionWorker(FactoryOperation factoryOperation, ICache cache)
|
||||
{
|
||||
Cache = AscCache.Memory;
|
||||
Cache = cache;
|
||||
Locker = new object();
|
||||
FactoryOperation = factoryOperation;
|
||||
}
|
||||
|
@ -49,9 +49,9 @@ namespace ASC.Data.Storage.Migration
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.Data.Storage.Migration", "ASC.Migration");
|
||||
diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>));
|
||||
|
||||
|
@ -91,7 +91,7 @@ namespace ASC.ElasticSearch
|
||||
private IServiceProvider ServiceProvider { get; }
|
||||
public string IndexName { get => Indexer.IndexName; }
|
||||
|
||||
public ICache Cache { get; }
|
||||
private ICache Cache { get; }
|
||||
public virtual string SettingsTitle { get => ""; }
|
||||
|
||||
public FactoryIndexer(
|
||||
|
@ -52,6 +52,7 @@ namespace ASC.Notify
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.Notify", "ASC.Notify.Messages");
|
||||
|
@ -76,7 +76,8 @@ namespace ASC.Socket.IO.Svc
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>));
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.Socket.IO.Svc");
|
||||
|
@ -53,6 +53,7 @@ namespace ASC.Studio.Notify
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>));
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.Notify", "ASC.Notify.Messages");
|
||||
|
@ -76,7 +76,8 @@ namespace ASC.Thumbnails.Svc
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>));
|
||||
|
@ -74,7 +74,8 @@ namespace ASC.UrlShortener.Svc
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.UrlShortener.Svc");
|
||||
services.AddHostedService<UrlShortenerServiceLauncher>();
|
||||
|
@ -37,8 +37,6 @@ using ASC.Files.Core.Resources;
|
||||
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
{
|
||||
[Singletone(Additional = typeof(FileOperationsManagerHelperExtention))]
|
||||
@ -57,8 +55,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
public ItemList<FileOperationResult> GetOperationResults(Guid userId)
|
||||
{
|
||||
var operations = tasks.GetTasks();
|
||||
var processlist = Process.GetProcesses();
|
||||
TestContext.WriteLine($"operations.Any: {operations.Any()}");
|
||||
var processlist = Process.GetProcesses();
|
||||
|
||||
//TODO: replace with distributed cache
|
||||
if (processlist.Any())
|
||||
@ -77,7 +74,6 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
tasks.RemoveTask(o.Id);
|
||||
}
|
||||
|
||||
TestContext.WriteLine($"operations1.Any: {operations.Any()}");
|
||||
var results = operations
|
||||
.Where(o => o.GetProperty<bool>(FileOperation.HOLD) || o.GetProperty<int>(FileOperation.PROGRESS) != 100)
|
||||
.Select(o => new FileOperationResult
|
||||
@ -163,8 +159,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
|
||||
|
||||
private ItemList<FileOperationResult> QueueTask(Guid userId, FileOperation op)
|
||||
{
|
||||
tasks.QueueTask(op.RunJob, op.GetDistributedTask());
|
||||
TestContext.WriteLine($"tasks.Any: {tasks.GetTasks().Any()}");
|
||||
tasks.QueueTask(op.RunJob, op.GetDistributedTask());
|
||||
return GetOperationResults(userId);
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,8 @@ namespace ASC.Files.Service
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>));
|
||||
|
@ -281,10 +281,12 @@ namespace ASC.Files.Tests
|
||||
while (true)
|
||||
{
|
||||
statuses = FileStorageService.GetTasksStatuses();
|
||||
TestContext.WriteLine($"statuses.Any: {statuses.Any()}");
|
||||
|
||||
if (statuses.TrueForAll(r => r.Finished))
|
||||
break;
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace ASC.Web.Core.Mail
|
||||
public MailServiceHelperStorage MailServiceHelperStorage { get; }
|
||||
private EFLoggerFactory LoggerFactory { get; }
|
||||
private MailDbContext MailDbContext { get; }
|
||||
public ICache Cache { get; }
|
||||
private ICache Cache { get; }
|
||||
|
||||
public MailServiceHelper(
|
||||
UserManager userManager,
|
||||
|
@ -62,8 +62,8 @@ namespace ASC.Web.Core.Sms
|
||||
public readonly TimeSpan StoreInterval;
|
||||
public readonly int AttemptCount;
|
||||
private static readonly object KeyLocker = new object();
|
||||
public ICache KeyCache { get; }
|
||||
public ICache CheckCache { get; }
|
||||
private ICache KeyCache { get; }
|
||||
private ICache CheckCache { get; }
|
||||
|
||||
private TenantManager TenantManager { get; }
|
||||
public SmsKeyStorageCache SmsKeyStorageCache { get; }
|
||||
|
@ -45,7 +45,7 @@ namespace ASC.Web.Core
|
||||
[Singletone]
|
||||
public class WebItemSecurityCache
|
||||
{
|
||||
public ICache Cache { get; }
|
||||
private ICache Cache { get; }
|
||||
private ICacheNotify<WebItemSecurityNotifier> CacheNotify { get; }
|
||||
|
||||
public WebItemSecurityCache(ICacheNotify<WebItemSecurityNotifier> cacheNotify, ICache cache)
|
||||
|
@ -52,7 +52,7 @@ namespace ASC.Web.Core.WhiteLabel
|
||||
private set;
|
||||
}
|
||||
|
||||
public ICache Cache { get; }
|
||||
private ICache Cache { get; }
|
||||
private ICacheNotify<TenantLogoCacheItem> CacheNotify { get; }
|
||||
|
||||
public TenantLogoManager(
|
||||
|
Loading…
Reference in New Issue
Block a user