Skip to content

Commit

Permalink
Update todos
Browse files Browse the repository at this point in the history
  • Loading branch information
frou committed Aug 9, 2019
1 parent 4d2ab3d commit fad90c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ os:
- osx
- windows

# TODO: Run golangci-lint via Travis
# @todo #0 Run golangci-lint via Travis
2 changes: 2 additions & 0 deletions Magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/magefile/mage/sh"
)

// @todo #0 Get rid of mage and write a bash script ./task that takes an argument

var Default = StampedBuild

func GitRepoIsClean() error {
Expand Down
10 changes: 4 additions & 6 deletions health.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ var healthConcerns = map[string]healthFunc{
}

const (
// TODO: Make these optionally configurable in the config file.
// @todo #0 Make diskLowThreshold & ytdlOldThreshold customizable in the config file.
diskLowThreshold = 1024 * 1024 * 1024 // 1GB
ytdlOldThreshold = time.Hour * 24 * 60 // 60 days
// TODO: Make this optionally configurable per-podcast in the config file.
// @todo #0 Make feedsStaleThreshold customizable per-podcast in the config file.
feedsStaleThreshold = time.Hour * 24 * 10 // 10 days
)

Expand Down Expand Up @@ -81,15 +81,13 @@ func healthHandler(w http.ResponseWriter, r *http.Request) {
type healthFunc func() (bool, error)

func diskLow() (bool, error) {
// TODO(DH): Pass the global `dataPath` as the path to check?
ok := du.NewDiskUsage(".").Available() < diskLowThreshold
return ok, nil
}

func ytdlOld() (bool, error) {
// TODO: Cache this for ... minutes because otherwise requesting /health
// could be a DoS because every request forks a process that takes ~2s to
// run.
// @todo #0 Cache ytdl version output for a while to prevent reqs to /health causing DoS.
// Because each request currently forks the ytdl process that takes ~2s to run.
version, err := exec.Command(downloadCmdName, "--version").Output()
if err != nil {
return false, err
Expand Down

0 comments on commit fad90c3

Please sign in to comment.