Remove STEMtv client since the service has been discontinued.

This commit is contained in:
Patrick Fairbank
2018-09-23 12:21:32 -07:00
parent 36c7c56212
commit f8466f743a
9 changed files with 28 additions and 126 deletions

View File

@@ -410,16 +410,6 @@ func (web *Web) commitMatchScore(match *model.Match, matchResult *model.MatchRes
}()
}
if web.arena.EventSettings.StemTvPublishingEnabled && match.Type != "practice" {
// Publish asynchronously to STEMtv.
go func() {
err = web.arena.StemTvClient.PublishMatchVideoSplit(match, time.Now())
if err != nil {
log.Printf("Failed to publish match video split to STEMtv: %s", err.Error())
}
}()
}
// Back up the database, but don't error out if it fails.
err = web.arena.Database.Backup(web.arena.EventSettings.Name, fmt.Sprintf("post_%s_match_%s", match.Type, match.DisplayName))
if err != nil {

View File

@@ -157,11 +157,9 @@ func TestCommitMatch(t *testing.T) {
match, _ = web.arena.Database.GetMatchById(1)
assert.Equal(t, "T", match.Winner)
// Verify TBA and STEMtv publishing by checking the log for the expected failure messages.
// Verify TBA publishing by checking the log for the expected failure messages.
web.arena.TbaClient.BaseUrl = "fakeUrl"
web.arena.StemTvClient.BaseUrl = "fakeUrl"
web.arena.EventSettings.TbaPublishingEnabled = true
web.arena.EventSettings.StemTvPublishingEnabled = true
var writer bytes.Buffer
log.SetOutput(&writer)
err = web.commitMatchScore(match, matchResult, false)
@@ -169,7 +167,6 @@ func TestCommitMatch(t *testing.T) {
time.Sleep(time.Millisecond * 10) // Allow some time for the asynchronous publishing to happen.
assert.Contains(t, writer.String(), "Failed to publish matches")
assert.Contains(t, writer.String(), "Failed to publish rankings")
assert.Contains(t, writer.String(), "Failed to publish match video split to STEMtv")
}
func TestCommitEliminationTie(t *testing.T) {

View File

@@ -48,8 +48,6 @@ func (web *Web) settingsPostHandler(w http.ResponseWriter, r *http.Request) {
eventSettings.TbaEventCode = r.PostFormValue("tbaEventCode")
eventSettings.TbaSecretId = r.PostFormValue("tbaSecretId")
eventSettings.TbaSecret = r.PostFormValue("tbaSecret")
eventSettings.StemTvPublishingEnabled = r.PostFormValue("stemTvPublishingEnabled") == "on"
eventSettings.StemTvEventCode = r.PostFormValue("stemTvEventCode")
eventSettings.NetworkSecurityEnabled = r.PostFormValue("networkSecurityEnabled") == "on"
eventSettings.ApAddress = r.PostFormValue("apAddress")
eventSettings.ApUsername = r.PostFormValue("apUsername")