feat: new data
Gitea Auto Deploy / Deploy-Container (push) Failing after 53s

This commit is contained in:
2026-06-02 18:24:12 +07:00
parent ee101f3851
commit 796969a174
60 changed files with 1126 additions and 984 deletions
+8 -1
View File
@@ -1,4 +1,11 @@
export function randomPartition(sum: number, parts: number): number[] {
if (!Number.isFinite(sum) || !Number.isInteger(parts) || parts <= 0) {
return [];
}
if (sum < parts) {
return Array.from({ length: parts }, () => 0);
}
const raw = Array.from({ length: parts }, () => Math.random());
const total = raw.reduce((a, b) => a + b, 0);
const result = raw.map(r => Math.floor((r / total) * (sum - parts)) + 1);
@@ -24,4 +31,4 @@ export function randomStep(x: number): number {
total += Math.floor(Math.random() * 3);
}
return total;
}
}