Oh, if http server stop fail, then most listened song will not be saved. Fix that.
This commit is contained in:
parent
4e16f2b3ed
commit
acd0087ddf
@ -86,9 +86,9 @@ func main() {
|
||||
|
||||
<-doneSignal
|
||||
|
||||
os.WriteFile(config.MostListenedSongPath, radio.StoreMostListenedSong(), fs.ModePerm)
|
||||
|
||||
if err := srv.Stop(); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
os.WriteFile(config.MostListenedSongPath, radio.StoreMostListenedSong(), fs.ModePerm)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user