Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix scraper again (fucking postgres)

Cette révision appartient à :
sfan5 2017-06-26 15:06:50 +02:00
Parent 912ea1645c
révision 054df5f8c3
2 fichiers modifiés avec 2 ajouts et 2 suppressions

Voir le fichier

@ -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 "+

Voir le fichier

@ -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