Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MosógépSCH
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Disappointment industries™
MosógépSCH
Commits
f5b8d8da
Commit
f5b8d8da
authored
Mar 2, 2022
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
Fix division by zero
parent
8ba372c9
No related branches found
No related tags found
No related merge requests found
Pipeline
#19778
passed
Mar 2, 2022
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/src/main/kotlin/space/rethelyi/model/Machine.kt
+1
-7
1 addition, 7 deletions
backend/src/main/kotlin/space/rethelyi/model/Machine.kt
with
1 addition
and
7 deletions
backend/src/main/kotlin/space/rethelyi/model/Machine.kt
+
1
−
7
View file @
f5b8d8da
...
@@ -29,13 +29,7 @@ enum class Kind {
...
@@ -29,13 +29,7 @@ enum class Kind {
}
}
val
Machine
.
status
:
Status
get
()
{
val
Machine
.
status
:
Status
get
()
{
var
averagePower
=
0
return
if
(
power
.
average
()
>
threshold
)
{
power
.
forEach
{
p
->
averagePower
+=
p
}
averagePower
/=
power
.
size
return
if
(
averagePower
>
threshold
)
{
Status
.
NotAvailable
Status
.
NotAvailable
}
else
{
}
else
{
Status
.
Available
Status
.
Available
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment