debug messages
parent
598804e95c
commit
d919cd65e7
|
|
@ -106,9 +106,11 @@ func OnPubStop(c *fiber.Ctx) error {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
duration := now.Sub(transm.StartTime)
|
duration := now.Sub(transm.StartTime)
|
||||||
|
|
||||||
|
minutes := float64(duration) / float64(time.Minute)
|
||||||
|
|
||||||
// TODO: Updates the transmission on database for future calculation of remaining daily time
|
// TODO: Updates the transmission on database for future calculation of remaining daily time
|
||||||
|
|
||||||
msg := fmt.Sprintf("Transmissão encerrada: Duration %s\n", duration)
|
msg := fmt.Sprintf("Transmissão encerrada: Duration %d\n", int(minutes))
|
||||||
|
|
||||||
services.AddTransmissionlog(p.StreamName, msg)
|
services.AddTransmissionlog(p.StreamName, msg)
|
||||||
return c.SendString("On_Pub_Stop: " + string(c.Body()))
|
return c.SendString("On_Pub_Stop: " + string(c.Body()))
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ func VerifyTransmissionsLimits() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddTransmissionlog(channelname, "Verificando expiração de transmissão")
|
||||||
|
|
||||||
// TODO: Implementar verificação de limite de transmissão diária (ou seja, quanto já foi transmitido HOJE)
|
// TODO: Implementar verificação de limite de transmissão diária (ou seja, quanto já foi transmitido HOJE)
|
||||||
if time.Now().After(currentTransmission.Limit) {
|
if time.Now().After(currentTransmission.Limit) {
|
||||||
AddTransmissionlog(channelname, "Limite de transmissão diária atingido")
|
AddTransmissionlog(channelname, "Limite de transmissão diária atingido")
|
||||||
|
|
@ -48,7 +50,7 @@ func VerifyTransmissionAuthorization(channelname, sessionid, transmissionkey str
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the channel expiration date is reached, kick the session
|
// If the channel expiration date is reached, kick the session
|
||||||
if channel.DateLimit.After(time.Now()) {
|
if time.Now().After(channel.DateLimit) {
|
||||||
AddTransmissionlog(channelname, "Canal com data de expiração vencida")
|
AddTransmissionlog(channelname, "Canal com data de expiração vencida")
|
||||||
utils.KickSession(channelname, sessionid)
|
utils.KickSession(channelname, sessionid)
|
||||||
return false, currentTransmission
|
return false, currentTransmission
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue