Deploy the DriverRank.jl script as part of the scouting app
The script still can't run for a few reasons, but at least it's
deployed now. The next step is to figure out how to run it properly.
The current scouting server will print something like this at a 10
minute interval:
2023/03/07 19:09:37 Failed to run the driver ranking script: fork/exec /home/jenkins/repos/971-Robot-Code-2/scouting/DriverRank/src/DriverRank.jl: permission denied
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I6540f9608deb9b41c436ea63eee2f77142db45e7
diff --git a/scouting/webserver/main.go b/scouting/webserver/main.go
index 1811b7f..4752cf4 100644
--- a/scouting/webserver/main.go
+++ b/scouting/webserver/main.go
@@ -15,6 +15,7 @@
"github.com/frc971/971-Robot-Code/scouting/db"
"github.com/frc971/971-Robot-Code/scouting/scraping/background"
+ "github.com/frc971/971-Robot-Code/scouting/webserver/driver_ranking"
"github.com/frc971/971-Robot-Code/scouting/webserver/match_list"
"github.com/frc971/971-Robot-Code/scouting/webserver/rankings"
"github.com/frc971/971-Robot-Code/scouting/webserver/requests"
@@ -139,6 +140,13 @@
rankings.GetRankings(database, 0, "", *blueAllianceConfigPtr)
})
+ driverRankingParser := background.BackgroundScraper{}
+ driverRankingParser.Start(func() {
+ // Specify "" as the script path here so that the default is
+ // used.
+ driver_ranking.GenerateFullDriverRanking(database, "")
+ })
+
// Block until the user hits Ctrl-C.
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, syscall.SIGINT)
@@ -149,6 +157,7 @@
fmt.Println("Shutting down.")
scoutingServer.Stop()
rankingsScraper.Stop()
+ driverRankingParser.Stop()
matchListScraper.Stop()
fmt.Println("Successfully shut down.")
}