Cizz22 3 months ago
parent 43a3aba7bf
commit 1702893189

@ -1,3 +1,4 @@
import asyncio
from typing import Dict, List, Optional from typing import Dict, List, Optional
from temporalio.client import Client from temporalio.client import Client
from fastapi import APIRouter, HTTPException, status from fastapi import APIRouter, HTTPException, status
@ -76,13 +77,13 @@ async def get_target_reliability(
print(f"Workflow {workflow_id} finished with status: {status}") print(f"Workflow {workflow_id} finished with status: {status}")
return status return status
print(f"Workflow {workflow_id} still {status}, checking again in {interval} seconds...") print(f"Workflow {workflow_id} still {status}, checking again in {30} seconds...")
except WorkflowNotFoundError: except Exception as e:
print(f"Workflow {workflow_id} not found, treating as done.") print(f"Workflow {workflow_id} not found, treating as done.")
return "NOT_FOUND" return "NOT_FOUND"
await asyncio.sleep(interval) await asyncio.sleep(30)

@ -96,9 +96,15 @@ def calculate_asset_eaf_contributions(plant_result, eq_results, standard_scope,
for asset in eq_results: for asset in eq_results:
asset_name = asset.get("aeros_node").get("node_name") asset_name = asset.get("aeros_node").get("node_name")
contribution_factor = 0
birbaum = 0
current_availability = 0
downtime = 0
if asset_name not in standard_scope: if asset_name not in standard_scope:
continue continue
if asset:
contribution_factor = asset.get("contribution_factor", 0.0) contribution_factor = asset.get("contribution_factor", 0.0)
birbaum = asset.get("contribution", 0.0) birbaum = asset.get("contribution", 0.0)
current_availability = asset.get("availability", 0.0) current_availability = asset.get("availability", 0.0)

@ -109778,7 +109778,7 @@
"Description": "WALL DESLAGGER A-2", "Description": "WALL DESLAGGER A-2",
"Location": "3AI-Y502A", "Location": "3AI-Y502A",
"Estimasi Waktu Maint. / Downtime / Gangguan (Jam)": 2880.0, "Estimasi Waktu Maint. / Downtime / Gangguan (Jam)": 2880.0,
"Diskripsi Operasional Akibat Equip. Failure": "Trip" "Diskripsi Operasional Akibat Equip. Failure": "No Effect"
}, },
{ {
"Asset No.": "A22949", "Asset No.": "A22949",

@ -62,7 +62,7 @@ filtered_wo AS (
FROM wo_costs w FROM wo_costs w
JOIN location_max lm ON w.asset_location = lm.asset_location JOIN location_max lm ON w.asset_location = lm.asset_location
WHERE w.total_wo_cost > 0 WHERE w.total_wo_cost > 0
AND w.total_wo_cost >= lm.max_cost * 0.10 -- keep within 10% of max AND w.total_wo_cost >= lm.max_cost * 0.1 -- keep within 10% of max
) )
SELECT SELECT
asset_location, asset_location,

Loading…
Cancel
Save