mirror of
https://github.com/status-im/status-go.git
synced 2025-01-25 22:19:51 +00:00
4b0daeb47b
Move all the services to status-node, as some of them were there, some of them were in the geth backend and scattered around.
15 lines
289 B
Go
15 lines
289 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
func createContextFromTimeout(timeout int) (context.Context, context.CancelFunc) {
|
|
if timeout == 0 {
|
|
return context.WithCancel(context.Background())
|
|
}
|
|
|
|
return context.WithTimeout(context.Background(), time.Duration(timeout)*time.Minute)
|
|
}
|