1
0

Cache vars moved to the top of the file.

This commit is contained in:
Alexander Andreev 2022-08-29 09:08:08 +04:00
parent c935db8ce7
commit 1996743470
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -22,6 +22,11 @@ const (
bufferSize = 8192 bufferSize = 8192
) )
var (
lastPlayedCache []Song = make([]Song, 10)
lastPlayedCacheMutex sync.Mutex
)
type IcecastStatusDTO struct { type IcecastStatusDTO struct {
Icestats struct { Icestats struct {
ServerStartISO8601 string `json:"server_start_iso8601"` ServerStartISO8601 string `json:"server_start_iso8601"`
@ -158,8 +163,6 @@ func lastPlayedSong(playlistPath string) (*Song, error) {
var playlistWatcher watcher.InotifyWatcher var playlistWatcher watcher.InotifyWatcher
var playlistFired chan uint32 = make(chan uint32) var playlistFired chan uint32 = make(chan uint32)
var lastPlayedCache []Song = make([]Song, 10)
var lastPlayedCacheMutex sync.Mutex
func IcecastWatchPlaylist(playlistPath string, lastNSongs int) error { func IcecastWatchPlaylist(playlistPath string, lastNSongs int) error {
playlistWatcher, err := watcher.NewInotifyWatcher() playlistWatcher, err := watcher.NewInotifyWatcher()