mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge pull request #13431 from appwrite/CLO-4783-skip-build-usage-without-start
fix(usage): don't bill build compute when buildStartedAt is null
This commit is contained in:
1 file changed
+7
@@ -32,6 +32,13 @@ final class Build
|
||||
$buildDuration = (int) $deployment->getAttribute('buildDuration', 0) * 1000;
|
||||
$mbSeconds = (int) ($memory * $deployment->getAttribute('buildDuration', 0) * $cpus);
|
||||
|
||||
// Without a start stamp buildDuration falls back to wall clock since the
|
||||
// deployment was created, which would bill queue wait as build compute.
|
||||
if (empty($deployment->getAttribute('buildStartedAt'))) {
|
||||
$buildDuration = 0;
|
||||
$mbSeconds = 0;
|
||||
}
|
||||
|
||||
// Per-resource breakdown now travels as resource dimensions on the
|
||||
// Context (resolved to resourceType + resourceId in the usage pipeline)
|
||||
// instead of per-{resourceInternalId} metric-name templates.
|
||||
|
||||
Reference in new issue
Block a user