-the counter don't stop

This commit is contained in:
Miki 2023-12-05 16:11:16 +01:00
parent 3c58b3bef5
commit 2d95efcaf8
10 changed files with 19 additions and 21 deletions

View file

@ -167,9 +167,10 @@ func (stream *PriorityStream) SendPriority(pri []string) {
}
func (stream *PriorityStream) timer() {
if stream.Start {
timer := time.NewTimer(stream.Duration)
for {
for {
if stream.Start {
timer := time.NewTimer(stream.Duration)
select {
case <-timer.C:
stream.Start = false
@ -178,10 +179,10 @@ func (stream *PriorityStream) timer() {
Mode: Stop.String(),
}
stream.Message <- msg
return
continue
default:
if len(stream.TotalClients) > 0 {
currentTimer := fmt.Sprintf("The Current Time Is %v", formatTime(stream.Duration))
currentTimer := fmt.Sprintf("%v", formatTime(stream.Duration))
msg := Message{
Duration: currentTimer,