File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313from sqlmodel import select
1414from werkzeug .utils import secure_filename
1515
16+ import murfey .server .prometheus as prom
1617from murfey .server .api .auth import MurfeyInstrumentNameFrontend as MurfeyInstrumentName
1718from murfey .server .api .auth import MurfeySessionIDFrontend as MurfeySessionID
1819from murfey .server .api .auth import (
@@ -555,8 +556,8 @@ async def flush_skipped_rsyncer(
555556 db .commit ()
556557
557558 # Send request to flush rsyncer
558- data : dict = {}
559559 update_result : dict = {}
560+ flush_result : dict = {}
560561 machine_config = get_machine_config (instrument_name = instrument_name )[
561562 instrument_name
562563 ]
@@ -583,8 +584,14 @@ async def flush_skipped_rsyncer(
583584 "Authorization" : f"Bearer { instrument_server_tokens [session_id ]['access_token' ]} "
584585 },
585586 ) as resp :
586- data = await resp .json ()
587- return data
587+ flush_result = await resp .json ()
588+ if not flush_result .get ("success" , False ):
589+ return {"success" : False }
590+ # Reset the skipped file count for the specific Prometheus gauge to 0
591+ prom .skipped_files .labels (
592+ rsync_source = rsyncer_source .source , visit = session_entry .visit
593+ ).set (0 )
594+ return flush_result
588595
589596
590597class RSyncerInfo (BaseModel ):
You can’t perform that action at this time.
0 commit comments