Пример #1
0
func processSaveResumeDataAlert(alert lt.Alert) {
	saveResumeDataAlert := lt.SwigcptrSaveResumeDataAlert(alert.Swigcptr())
	log.Printf("Saving resume data to: %s", config.resumeFile)
	data := lt.Bencode(saveResumeDataAlert.ResumeData())
	err := ioutil.WriteFile(config.resumeFile, []byte(data), 0644)
	if err != nil {
		log.Println(err)
	}
}
Пример #2
0
func consumeAlerts() {
	for {
		var alert lt.Alert
		if alert = popAlert(true); alert == nil {
			break
		}
		if alert.What() == "save_resume_data_alert" {
			processSaveResumeDataAlert(alert)
		}
	}
}