Browse Source

Fix time format, quiet logging a bit

master
Tyler Sommer 1 year ago
parent
commit
eeebf4b0d1
Signed by: tyler-sommer GPG Key ID: C09C010500DBD008
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      cmd/spaced/main.go

+ 4
- 4
cmd/spaced/main.go View File

@ -143,10 +143,10 @@ func worker(stop chan struct{}) {
case event.Op&fsnotify.Create == fsnotify.Create:
f := filepath.Base(event.Name)
if strings.HasPrefix(f, ".") {
log.Println("new file created, not uploading:", f)
//log.Println("new file created, not uploading:", f)
continue
} else if !strings.HasSuffix(f, ".png") {
log.Println("non png created, not uploading:", f)
//log.Println("non png created, not uploading:", f)
continue
}
_, err := s3.FPutObject(f, event.Name)
@ -165,9 +165,9 @@ func worker(stop chan struct{}) {
log.Println("error getting short share url:", err.Error())
continue
}
log.Printf("Share URL: %s\t(valid until %s)\n",
log.Printf("Share URL: %s (valid until %s)\n",
su.String(),
time.Now().Add(time.Duration(config.ShareTTL)).Format("Jan 02 15:02 MST"))
time.Now().Add(time.Duration(config.ShareTTL)).Format("Jan 02 15:04 MST"))
cmd := exec.Command("pbcopy")
p, err := cmd.StdinPipe()
if err != nil {

Loading…
Cancel
Save