示例#1
0
文件: killer.go 项目: tcard/goci
func clean_processes(app, api string) {
	cl := heroku.New(app, api)
	ps, err := cl.List()
	if err != nil {
		log.Printf("error listing process: %s", err)
		return
	}

	for _, p := range ps {
		//only kill processes running longer than too long
		if p.Elapsed <= too_long {
			continue
		}
		//only kill processes that are in the run command type
		if strings.HasPrefix(p.Process, "run") {
			continue
		}

		//KEEL IT
		err := cl.Kill(p.Process)
		if err != nil {
			log.Printf("error killing %s: %s", p.Process, err)
		}
	}
}
示例#2
0
文件: config.go 项目: jbaikge/goci
func (c Config) BuildHerokuClient() *heroku.Client {
	return heroku.New(c.App, c.Api)
}