Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions SemanticBackup.Core/Models/RSSettings.cs

This file was deleted.

69 changes: 0 additions & 69 deletions SemanticBackup.Core/Models/Requests/RSSettings.cs

This file was deleted.

34 changes: 0 additions & 34 deletions SemanticBackup.Core/Models/Requests/ResourceGroupRequest.cs

This file was deleted.

9 changes: 4 additions & 5 deletions SemanticBackup.Core/Models/ResourceGroup.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace SemanticBackup.Core.Models
{
public class ResourceGroup
{
[Key, Required]
public string Id { get; set; } = Guid.NewGuid().ToString().ToUpper();
public string Id { get; set; }
[Required]
public string Key { get { return Name.FormatToUrlStyle(); } }
public string Key { get { return Name?.FormatToUrlStyle(); } }
[Required]
public string Name { get; set; }
//Shared Db Connection Configs
Expand All @@ -21,7 +20,7 @@ public class ResourceGroup
[Required]
public string DbType { get; set; } = DbTypes.SQLSERVER2019.ToString();
//Other Configs
public int MaximumRunningBots { get; set; } = 1;
public int MaximumRunningBots { get; set; } = 2;
public bool CompressBackupFiles { get; set; } = true;
public int BackupExpiryAgeInDays { get; set; } = 7;
//delivery Configs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void SetupBackgroundService(CancellationToken cancellationToken)
_logger.LogWarning($"Queued for Backup but was unable to update backup record Key: #{backupRecord.Id} status");
}
else
_logger.LogInformation($"Resource Group With Id: {resourceGroup.Id} has Exceeded its Maximum Allocated Running Threads Count: {resourceGroup.MaximumRunningBots}");
_logger.LogInformation($"Resource Group With Id: {resourceGroup.Id} Bots are Busy, Running Bots Count: {resourceGroup.MaximumRunningBots}, waiting for available Bots....");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void SetupBackgroundService(CancellationToken cancellationToken)
else
{
//Override Maximum Running Threads// This is because of currently being used exception
if (_botsManagerBackgroundJob.HasAvailableResourceGroupBotsCount(resourceGroup.Id, 1))
if (_botsManagerBackgroundJob.HasAvailableResourceGroupBotsCount(resourceGroup.Id, resourceGroup.MaximumRunningBots))
{
string status = BackupRecordDeliveryStatus.EXECUTING.ToString();
string statusMsg = "Dispatching Backup Record";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void SetupBackgroundService(CancellationToken cancellationToken)
List<BackupSchedule> dueSchedules = await backupSchedulePersistanceService.GetAllDueByDateAsync();
if (dueSchedules != null && dueSchedules.Count > 0)
{
List<string> scheduleToDelete = new List<string>();
List<string> scheduleToDelete = [];
foreach (BackupSchedule schedule in dueSchedules.OrderBy(x => x.NextRunUTC).ToList())
{
_logger.LogInformation($"Queueing Scheduled Backup...");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using LiteDB;
using LiteDB.Async;
using SemanticBackup.Core;
using SemanticBackup.Core.Interfaces;
using SemanticBackup.Core.Models;
using System;
Expand All @@ -25,9 +26,10 @@ public ResourceGroupRepositoryLiteDb(IBackupRecordRepository backupRecordPersist
this._backupSchedulePersistanceService = backupSchedulePersistanceService;
this._databaseInfoPersistanceService = databaseInfoPersistanceService;
}

public async Task<bool> AddAsync(ResourceGroup record)
{
record.Id = Guid.NewGuid().ToString().ToUpper();
record.Id = record.Name.FormatToUrlStyle();
record.Name = record.Name.Trim();
//attempt to check if exists
ResourceGroup preExistingRecord = await GetByIdOrKeyAsync(record.Id);
Expand Down
Loading
Loading