@@ -199,11 +199,11 @@ func archiveLog(format string, args ...interface{}) {
199199 fmt .Fprintf (f , "%s: [drive-map] %s\n " , time .Now ().Format ("Mon 02 Jan 15:04:05 MST 2006" ), msg )
200200}
201201
202- // isArchiving returns true if the archiveloop is currently archiving files.
202+ // IsArchiving returns true if the archiveloop is currently archiving files.
203203// The archive_progress_monitor updates the status file every 5s, so if it
204204// hasn't been touched in over 120s, treat it as stale (archiveloop crashed
205205// or forgot to clear it).
206- func isArchiving () bool {
206+ func IsArchiving () bool {
207207 const statusFile = "/tmp/archive_status.json"
208208 info , err := os .Stat (statusFile )
209209 if err != nil {
@@ -262,7 +262,7 @@ func (dh *DriveHandlers) processFiles(w http.ResponseWriter, r *http.Request) {
262262 // post_archive=1 is set by post-archive-process.sh which runs after
263263 // archiving is complete. Skip the stale-file check in that case.
264264 postArchive := r .URL .Query ().Get ("post_archive" ) == "1"
265- if ! postArchive && isArchiving () {
265+ if ! postArchive && IsArchiving () {
266266 writeError (w , http .StatusConflict , "archive is currently running — please wait until it finishes" )
267267 return
268268 }
@@ -346,7 +346,7 @@ func (dh *DriveHandlers) reprocessAll(w http.ResponseWriter, r *http.Request) {
346346 writeError (w , http .StatusConflict , "processing already in progress" )
347347 return
348348 }
349- if isArchiving () {
349+ if IsArchiving () {
350350 writeError (w , http .StatusConflict , "archive is currently running — please wait until it finishes" )
351351 return
352352 }
@@ -409,7 +409,7 @@ func (dh *DriveHandlers) processingStatus(w http.ResponseWriter, r *http.Request
409409 "running" : dh .processor .IsRunning (),
410410 "routes_count" : dh .store .RouteCount (),
411411 "processed_count" : dh .store .ProcessedCount (),
412- "archiving" : isArchiving (),
412+ "archiving" : IsArchiving (),
413413 }
414414
415415 if archive := readArchiveStatus (); archive != nil {
@@ -503,18 +503,18 @@ func (dh *DriveHandlers) driveStats(w http.ResponseWriter, r *http.Request) {
503503 }
504504
505505 writeJSON (w , http .StatusOK , map [string ]interface {}{
506- "drives_count" : len (allDrives ),
507- "routes_count" : len (routes ),
508- "processed_count" : dh .store .ProcessedCount (),
509- "total_distance_km" : math .Round (totalDistKm * 100 ) / 100 ,
510- "total_distance_mi" : math .Round (totalDistMi * 100 ) / 100 ,
511- "total_duration_ms" : totalDurationMs ,
512- "fsd_engaged_ms" : totalFSDEngagedMs ,
513- "fsd_distance_km" : math .Round (totalFSDDistKm * 100 ) / 100 ,
514- "fsd_distance_mi" : math .Round (totalFSDDistMi * 100 ) / 100 ,
515- "fsd_percent" : fsdPercent ,
516- "fsd_disengagements" : totalDisengagements ,
517- "fsd_accel_pushes" : totalAccelPushes ,
506+ "drives_count" : len (allDrives ),
507+ "routes_count" : len (routes ),
508+ "processed_count" : dh .store .ProcessedCount (),
509+ "total_distance_km" : math .Round (totalDistKm * 100 ) / 100 ,
510+ "total_distance_mi" : math .Round (totalDistMi * 100 ) / 100 ,
511+ "total_duration_ms" : totalDurationMs ,
512+ "fsd_engaged_ms" : totalFSDEngagedMs ,
513+ "fsd_distance_km" : math .Round (totalFSDDistKm * 100 ) / 100 ,
514+ "fsd_distance_mi" : math .Round (totalFSDDistMi * 100 ) / 100 ,
515+ "fsd_percent" : fsdPercent ,
516+ "fsd_disengagements" : totalDisengagements ,
517+ "fsd_accel_pushes" : totalAccelPushes ,
518518 })
519519}
520520
@@ -561,12 +561,12 @@ func (dh *DriveHandlers) fsdAnalytics(w http.ResponseWriter, r *http.Request) {
561561
562562 // Daily breakdown
563563 type dayStats struct {
564- Date string `json:"date"`
565- DayName string `json:"dayName"`
566- Disengagements int `json:"disengagements"`
567- AccelPushes int `json:"accelPushes"`
568- FSDPercent float64 `json:"fsdPercent"`
569- Drives int `json:"drives"`
564+ Date string `json:"date"`
565+ DayName string `json:"dayName"`
566+ Disengagements int `json:"disengagements"`
567+ AccelPushes int `json:"accelPushes"`
568+ FSDPercent float64 `json:"fsdPercent"`
569+ Drives int `json:"drives"`
570570 }
571571 dailyMap := make (map [string ]* dayStats )
572572
0 commit comments