| OLD | NEW |
| 1 // capture_skps_on_workers is an application that captures SKPs of the | 1 // capture_skps_on_workers is an application that captures SKPs of the |
| 2 // specified patchset type on all CT workers and uploads the results to Google | 2 // specified patchset type on all CT workers and uploads the results to Google |
| 3 // Storage. The requester is emailed when the task is done. | 3 // Storage. The requester is emailed when the task is done. |
| 4 package main | 4 package main |
| 5 | 5 |
| 6 import ( | 6 import ( |
| 7 "bytes" | 7 "bytes" |
| 8 "flag" | 8 "flag" |
| 9 "fmt" | 9 "fmt" |
| 10 "strings" | 10 "strings" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if err := util.SendEmail(recipients, emailSubject, emailBody); err != ni
l { | 48 if err := util.SendEmail(recipients, emailSubject, emailBody); err != ni
l { |
| 49 glog.Errorf("Error while sending email: %s", err) | 49 glog.Errorf("Error while sending email: %s", err) |
| 50 return | 50 return |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 func updateWebappTask() { | 54 func updateWebappTask() { |
| 55 extraData := map[string]string{ | 55 extraData := map[string]string{ |
| 56 "output_link": outputRemoteLink, | 56 "output_link": outputRemoteLink, |
| 57 } | 57 } |
| 58 » if err := util.UpdateWebappTask(*gaeTaskID, util.CaptureSKPsTasksWebapp,
extraData); err != nil { | 58 » if err := util.UpdateWebappTask(*gaeTaskID, util.UpdateCaptureSKPsTasksW
ebapp, extraData); err != nil { |
| 59 glog.Errorf("Error while updating webapp task: %s", err) | 59 glog.Errorf("Error while updating webapp task: %s", err) |
| 60 return | 60 return |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 func main() { | 64 func main() { |
| 65 common.Init() | 65 common.Init() |
| 66 | 66 |
| 67 // Send start email. | 67 // Send start email. |
| 68 emailsArr := util.ParseEmails(*emails) | 68 emailsArr := util.ParseEmails(*emails) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 captureSKPsCmdBytes.String(), | 128 captureSKPsCmdBytes.String(), |
| 129 } | 129 } |
| 130 // Setting a 2 day timeout since it may take a while to capture 1M SKPs. | 130 // Setting a 2 day timeout since it may take a while to capture 1M SKPs. |
| 131 if _, err := util.SSH(strings.Join(cmd, " "), util.Slaves, 2*24*time.Hou
r); err != nil { | 131 if _, err := util.SSH(strings.Join(cmd, " "), util.Slaves, 2*24*time.Hou
r); err != nil { |
| 132 glog.Errorf("Error while running cmd %s: %s", cmd, err) | 132 glog.Errorf("Error while running cmd %s: %s", cmd, err) |
| 133 return | 133 return |
| 134 } | 134 } |
| 135 | 135 |
| 136 taskCompletedSuccessfully = true | 136 taskCompletedSuccessfully = true |
| 137 } | 137 } |
| OLD | NEW |