Skip to content

Commit

Permalink
Merge branch 'dev' into issue/OSOE-621
Browse files Browse the repository at this point in the history
  • Loading branch information
DemeSzabolcs committed May 25, 2023
2 parents f53fca5 + fcc3c3c commit 009c739
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Lombiq.Hosting.Tenants.EnvironmentRobots/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
Author = "Lombiq Technologies",
Website = "https://github.com/Lombiq/Hosting-Tenants",
Version = "0.0.1",
Description = "Prevents search bots from indexing non-production environments by adding a meta tag and a response header with noindex, nofollow values.",
Description = "Prevents search bots from indexing non-production environments by adding a meta tag and a response"
+ " header with noindex, nofollow values.",
Category = "Hosting"
)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Lombiq.Hosting.Tenants.MediaStorageManagement.Service;
public interface IMediaStorageQuotaService
{
/// <summary>
/// Returns remaining quota space left in bytes.
/// Returns remaining quota space left in bytes. It is always a non-negative number, meaning the minimum value is 0.
/// </summary>
Task<long> GetRemainingMediaSpaceQuotaLeftAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public async Task<long> GetRemainingMediaSpaceQuotaLeftAsync()

var listed = await directoryContent.ToListAsync();
var sumSize = listed.Where(item => item.Length > 0).Sum(item => item.Length);
return MaxSpaceForTenantInBytes() - sumSize;
var remainingSpace = MaxSpaceForTenantInBytes() - sumSize;

return remainingSpace < 0 ? 0 : remainingSpace;
}

public long MaxSpaceForTenantInBytes() => _mediaStorageManagementOptions.MaximumStorageQuota;
Expand Down

0 comments on commit 009c739

Please sign in to comment.