feat: enabled

This commit is contained in:
tresabhi committed 2025-03-21 18:08:53 -05:00
1 parent 9e2465a6e3
commit 1d928e8b72
1 file changed
+5 -6
+5 -6
View File
@@ -1,7 +1,5 @@
using System.Collections.Concurrent;
using System.Diagnostics; using System.Diagnostics;
using System.Net; using System.Net;
using System.Threading.Tasks;
using BlitzKit.CLI.Utils; using BlitzKit.CLI.Utils;
using DotNetEnv; using DotNetEnv;
using Octokit; using Octokit;
@@ -10,7 +8,8 @@ namespace BlitzKit.CLI.Models
{ {
public class AssetUploader(string message) public class AssetUploader(string message)
{ {
public required bool disabled; public bool enabled = true;
private static readonly int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000; private static readonly int TIME_PER_BLOB = (int)Math.Pow(2, 4) * 10000;
private static readonly int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9); private static readonly int TIME_BETWEEN_BLOBS = (int)(60 * 60 * 1000 / 5000 / 0.9);
private static readonly int MAX_TREE_SIZE = 7_000_000; // 7MB private static readonly int MAX_TREE_SIZE = 7_000_000; // 7MB
@@ -31,7 +30,7 @@ namespace BlitzKit.CLI.Models
public async Task Add(FileChange change) public async Task Add(FileChange change)
{ {
if (disabled) if (!enabled)
{ {
return; return;
} }
@@ -107,7 +106,7 @@ namespace BlitzKit.CLI.Models
public async Task Flush() public async Task Flush()
{ {
if (disabled || changes.Count == 0) if (!enabled || changes.Count == 0)
{ {
return; return;
} }
@@ -142,7 +141,7 @@ namespace BlitzKit.CLI.Models
await Task.Delay((int)Math.Max(0, TIME_BETWEEN_BLOBS - stopwatch.ElapsedMilliseconds)); await Task.Delay((int)Math.Max(0, TIME_BETWEEN_BLOBS - stopwatch.ElapsedMilliseconds));
PrettyLog.Success($"Blobbed {change.Path} (+{stopwatch.ElapsedMilliseconds}ms)"); PrettyLog.Background($"Blobbed {change.Path} (+{stopwatch.ElapsedMilliseconds}ms)");
newTree.Tree.Add( newTree.Tree.Add(
new() new()