Cache vars moved to the top of the file.
This commit is contained in:
parent
c935db8ce7
commit
1996743470
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user