Merge branch 'master' of github.com:tus/tusd

This commit is contained in:
Marius 2018-03-28 21:56:41 +02:00
commit e4017ff47e
6 changed files with 17 additions and 14 deletions

4
.gitignore vendored
View File

@ -1,9 +1,5 @@
tusd/data tusd/data
cover.out cover.out
data/ data/
.infra/env.*
.infra/ssh/tusd.pem
.infra/Frey-residu*
.infra/ssh/frey-tusd.pem
node_modules/ node_modules/
.DS_Store .DS_Store

View File

@ -32,7 +32,7 @@ spec:
containers: containers:
- image: docker.io/tusproject/tusd:latest - image: docker.io/tusproject/tusd:latest
imagePullPolicy: Always imagePullPolicy: Always
args: ["-port=8080","-behind-proxy","-max-size=1000000000"] args: ["-port=8080","-behind-proxy","-max-size=20000000000"]
name: tusd name: tusd
resources: resources:
limits: limits:

View File

@ -12,7 +12,6 @@ cache:
apt: true apt: true
directories: directories:
- $HOME/.gimme - $HOME/.gimme
- $HOME/.frey
- "$HOME/google-cloud-sdk/" - "$HOME/google-cloud-sdk/"
env: env:
global: global:
@ -33,7 +32,7 @@ before_deploy:
- gcloud --quiet version - gcloud --quiet version
- gcloud --quiet components update - gcloud --quiet components update
- gcloud --quiet components update kubectl - gcloud --quiet components update kubectl
- curl https://raw.githubusercontent.com/kubernetes/helm/8478fb4fc723885b155c924d1c8c410b7a9444e6/scripts/get | bash - curl https://raw.githubusercontent.com/kubernetes/helm/9476fcc10aaaf4bbcbeb6b7b9e62e9f03d312697/scripts/get | bash
deploy: deploy:
- provider: releases - provider: releases
api_key: api_key:

View File

@ -70,16 +70,16 @@ func invokeHook(typ HookType, info tusd.FileInfo) {
func invokeHookSync(typ HookType, info tusd.FileInfo, captureOutput bool) ([]byte, error) { func invokeHookSync(typ HookType, info tusd.FileInfo, captureOutput bool) ([]byte, error) {
switch typ { switch typ {
case HookPostFinish: case HookPostFinish:
logEv("UploadFinished", "id", info.ID, "size", strconv.FormatInt(info.Size, 10)) logEv(stdout, "UploadFinished", "id", info.ID, "size", strconv.FormatInt(info.Size, 10))
case HookPostTerminate: case HookPostTerminate:
logEv("UploadTerminated", "id", info.ID) logEv(stdout, "UploadTerminated", "id", info.ID)
} }
if !Flags.FileHooksInstalled && !Flags.HttpHooksInstalled { if !Flags.FileHooksInstalled && !Flags.HttpHooksInstalled {
return nil, nil return nil, nil
} }
name := string(typ) name := string(typ)
logEv("HookInvocationStart", "type", name, "id", info.ID) logEv(stdout, "HookInvocationStart", "type", name, "id", info.ID)
output := []byte{} output := []byte{}
err := error(nil) err := error(nil)
@ -93,9 +93,9 @@ func invokeHookSync(typ HookType, info tusd.FileInfo, captureOutput bool) ([]byt
} }
if err != nil { if err != nil {
logEv("HookInvocationError", "type", string(typ), "id", info.ID, "error", err.Error()) logEv(stderr, "HookInvocationError", "type", string(typ), "id", info.ID, "error", err.Error())
} else { } else {
logEv("HookInvocationFinish", "type", string(typ), "id", info.ID) logEv(stdout, "HookInvocationFinish", "type", string(typ), "id", info.ID)
} }
return output, err return output, err

View File

@ -10,6 +10,6 @@ import (
var stdout = log.New(os.Stdout, "[tusd] ", 0) var stdout = log.New(os.Stdout, "[tusd] ", 0)
var stderr = log.New(os.Stderr, "[tusd] ", 0) var stderr = log.New(os.Stderr, "[tusd] ", 0)
func logEv(eventName string, details ...string) { func logEv(logOutput *log.Logger, eventName string, details ...string) {
tusd.LogEvent(stderr, eventName, details...) tusd.LogEvent(logOutput, eventName, details...)
} }

8
tusd.code-workspace Normal file
View File

@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}