Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/ws-daemon/cmd/content-initializer/main.go
2500 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package main
6
7
import (
8
"fmt"
9
"math/rand"
10
"os"
11
"time"
12
13
"github.com/gitpod-io/gitpod/common-go/log"
14
"github.com/gitpod-io/gitpod/common-go/tracing"
15
"github.com/gitpod-io/gitpod/ws-daemon/pkg/content"
16
)
17
18
func main() {
19
rand.Seed(time.Now().UnixNano())
20
21
log.Init("content-initializer", "", true, false)
22
tracing.Init("content-initializer")
23
24
statsFd := os.NewFile(content.RUN_INITIALIZER_CHILD_STATS_FD, "stats")
25
26
err := content.RunInitializerChild(statsFd)
27
if err != nil {
28
errfd := os.NewFile(content.RUN_INITIALIZER_CHILD_ERROUT_FD, "errout")
29
_, _ = fmt.Fprintf(errfd, "%s", err.Error())
30
31
os.Exit(content.FAIL_CONTENT_INITIALIZER_EXIT_CODE)
32
}
33
}
34
35