mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 07:19:20 +01:00
chore(ws): increase timeouts
This commit is contained in:
parent
24cc613f1c
commit
ad53a302bf
@ -22,10 +22,10 @@ var upgrader = websocket.Upgrader{
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Time allowed to write a message to the peer.
|
// Time allowed to write a message to the peer.
|
||||||
writeWait = 10 * time.Second
|
writeWait = 2 * 10 * time.Second
|
||||||
|
|
||||||
// Time allowed to read the next pong message from the peer.
|
// Time allowed to read the next pong message from the peer.
|
||||||
pongWait = 60 * time.Second
|
pongWait = 2 * 60 * time.Second
|
||||||
|
|
||||||
// Send pings to peer with this period. Must be less than pongWait.
|
// Send pings to peer with this period. Must be less than pongWait.
|
||||||
pingPeriod = (pongWait * 9) / 10
|
pingPeriod = (pongWait * 9) / 10
|
||||||
@ -45,15 +45,15 @@ func (c *connection) readPump() {
|
|||||||
defer func() {
|
defer func() {
|
||||||
h.unregister <- c
|
h.unregister <- c
|
||||||
_ = c.ws.Close()
|
_ = c.ws.Close()
|
||||||
//util.LogErrorWithFields(c.ws.Close(), log.Fields{"error": "Error closing websocket"})
|
//util.LogErrorF(c.ws.Close(), log.Fields{"error": "Error closing websocket"})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
c.ws.SetReadLimit(maxMessageSize)
|
c.ws.SetReadLimit(maxMessageSize)
|
||||||
|
|
||||||
//util.LogErrorWithFields(c.ws.SetReadDeadline(time.Now().Add(pongWait)), log.Fields{"error": "Socket state corrupt"})
|
//util.LogErrorF(c.ws.SetReadDeadline(time.Now().Add(pongWait)), log.Fields{"error": "Socket state corrupt"})
|
||||||
//
|
//
|
||||||
//c.ws.SetPongHandler(func(string) error {
|
//c.ws.SetPongHandler(func(string) error {
|
||||||
// util.LogErrorWithFields(c.ws.SetReadDeadline(time.Now().Add(pongWait)), log.Fields{"error": "Socket state corrupt"})
|
// util.LogErrorF(c.ws.SetReadDeadline(time.Now().Add(pongWait)), log.Fields{"error": "Socket state corrupt"})
|
||||||
// return nil
|
// return nil
|
||||||
//})
|
//})
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package db
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -166,7 +167,7 @@ func (task *Task) ValidateNewTask(template Template) error {
|
|||||||
func (task *TaskWithTpl) Fill(d Store) error {
|
func (task *TaskWithTpl) Fill(d Store) error {
|
||||||
if task.BuildTaskID != nil {
|
if task.BuildTaskID != nil {
|
||||||
build, err := d.GetTask(task.ProjectID, *task.BuildTaskID)
|
build, err := d.GetTask(task.ProjectID, *task.BuildTaskID)
|
||||||
if err == ErrNotFound {
|
if errors.Is(err, ErrNotFound) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user