Fix scraper again (fucking postgres)
Cette révision appartient à :
Parent
912ea1645c
révision
054df5f8c3
2 fichiers modifiés avec 2 ajouts et 2 suppressions
|
@ -191,7 +191,7 @@ func (sc *Scraper) Scrape(packets uint) {
|
|||
oldest := now.Add(0 - (time.Hour * 24 * 90))
|
||||
|
||||
query := fmt.Sprintf(
|
||||
"SELECT * FROM ("+
|
||||
"SELECT * FROM ("+
|
||||
|
||||
// previously scraped torrents that will be scraped again:
|
||||
"SELECT %[1]s.torrent_id, torrent_hash FROM %[1]s, %[2]s WHERE "+
|
||||
|
|
|
@ -57,7 +57,7 @@ func (t *Transaction) handleScrapeReply(data []byte) {
|
|||
}
|
||||
|
||||
|
||||
var pgQuery = "REPLACE INTO " + config.Conf.Models.ScrapeTableName + " (torrent_id, seeders, leechers, completed, last_scrape) VALUES ($1, $2, $3, $4, $5)"
|
||||
var pgQuery = "INSERTE INTO " + config.Conf.Models.ScrapeTableName + " (torrent_id, seeders, leechers, completed, last_scrape) VALUES ($1, $2, $3, $4, $5) ON CONFLICT UPDATE"
|
||||
var sqliteQuery = "REPLACE INTO " + config.Conf.Models.ScrapeTableName + " (torrent_id, seeders, leechers, completed, last_scrape) VALUES (?, ?, ?, ?, ?)"
|
||||
|
||||
// Sync syncs models with database
|
||||
|
|
Référencer dans un nouveau ticket