Fix the race condition where the logo wasn't copied over for the default thumbnail

This commit is contained in:
Bradley Hilton 2020-06-18 19:35:09 -05:00
parent 465fa84b17
commit 42371a30fe
No known key found for this signature in database
GPG key ID: 78D97CF29F9840DA
2 changed files with 4 additions and 4 deletions

View file

@ -46,8 +46,7 @@ func copy(src, dst string) {
return
}
err = ioutil.WriteFile(dst, input, 0644)
if err != nil {
if err = ioutil.WriteFile(dst, input, 0644); err != nil {
fmt.Println("Error creating", dst)
fmt.Println(err)
return
@ -78,10 +77,11 @@ func resetDirectories(configuration Config) {
func createInitialOfflineState() {
// Provide default files
showStreamOfflineState(configuration)
if !fileExists("webroot/thumbnail.png") {
copy("static/logo.png", "webroot/thumbnail.png")
copy("static/logo-900x720.png", "webroot/thumbnail.png")
}
showStreamOfflineState(configuration)
}
func getClientIDFromRequest(req *http.Request) string {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB