Commit 1868373b authored by Richer Maximilien's avatar Richer Maximilien Committed by Loïck Bonniot

[c] Add net default timeout

parent 7e697f8d
......@@ -5,6 +5,7 @@ import (
cAPI "dfss/dfssc/api"
......@@ -85,6 +86,8 @@ func NewSignatureManager(passphrase string, c *contract.JSON) (*SignatureManager
m.mail = m.auth.Cert.Subject.CommonName
net.DefaultTimeout = viper.GetDuration("timeout")
m.cServer = m.GetServer()
go func() { _ = net.Listen(""+strconv.Itoa(viper.GetInt("local_port")), m.cServer) }()
......@@ -234,7 +237,7 @@ func (m *SignatureManager) addPeer(user *pAPI.User) (ready bool, err error) {
// SendReadySign sends the READY signal to the platform, and wait (potentially a long time) for START signal.
func (m *SignatureManager) SendReadySign() (signatureUUID string, err error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*viper.GetDuration("timeout"))
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
c := make(chan *pAPI.LaunchSignature)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment