249
249
System.Collections.Generic.List<string> delcmds = new System.Collections.Generic.List<string>();
250
ParseURLs parseulrs = new ParseURLs();
251
foreach (string url in urls)
250
using (ParseURLs parseulrs = new ParseURLs())
253
delcmds.Add("DELETE FROM `urlslist` WHERE `url_hash`='" + parseulrs.GetHash(url) + "';");
252
foreach (string url in urls)
254
delcmds.Add("DELETE FROM `urlslist` WHERE `url_hash`='" + parseulrs.GetHash(url) + "';");
256
257
using (IDbConnection dbcon = new MySqlConnection(this.connectionString))
391
392
dbcmd.CommandText = "SELECT SQL_NO_CACHE `url` FROM `urlslist` WHERE `http_code1`=" + status + " AND `http_code2`=" +
392
393
status + " AND `http_code3`=" + status + ";";
393
IDataReader reader = dbcmd.ExecuteReader();
394
StringBuilder solrcommand = new StringBuilder();
395
solrcommand.Append("<delete>");
396
string scommand = String.Empty;
397
while (reader.Read())
394
using (IDataReader reader = dbcmd.ExecuteReader())
399
solrcommand.Append("<id>http://");
400
solrcommand.Append(System.Security.SecurityElement.Escape(reader.GetString(0)));
401
solrcommand.Append("</id>");
396
StringBuilder solrcommand = new StringBuilder();
397
solrcommand.Append("<delete>");
398
string scommand = String.Empty;
399
while (reader.Read())
405
solrcommand.Append("</delete>");
406
scommand = System.Text.RegularExpressions.Regex.Replace(solrcommand.ToString(), @"[\p{IsC}]", String.Empty);
407
MainClass.SendCommand(scommand, "Solr");
408
MainClass.SendCommand("<commit/>", "Solr");
409
solrcommand.Remove(0, solrcommand.Length);
410
solrcommand.Append("<delete>");
401
solrcommand.Append("<id>http://");
402
solrcommand.Append(System.Security.SecurityElement.Escape(reader.GetString(0)));
403
solrcommand.Append("</id>");
407
solrcommand.Append("</delete>");
408
scommand = System.Text.RegularExpressions.Regex.Replace(solrcommand.ToString(), @"[\p{IsC}]", String.Empty);
409
MainClass.SendCommand(scommand, "Solr");
410
MainClass.SendCommand("<commit/>", "Solr");
411
solrcommand.Remove(0, solrcommand.Length);
412
solrcommand.Append("<delete>");
416
solrcommand.Append("</delete>");
417
scommand = System.Text.RegularExpressions.Regex.Replace(solrcommand.ToString(), @"[\p{IsC}]", String.Empty);
418
MainClass.SendCommand(scommand, "Solr");
419
MainClass.SendCommand("<commit/>", "Solr");
416
solrcommand.Append("</delete>");
417
scommand = System.Text.RegularExpressions.Regex.Replace(solrcommand.ToString(), @"[\p{IsC}]", String.Empty);
418
MainClass.SendCommand(scommand, "Solr");
419
MainClass.SendCommand("<commit/>", "Solr");
421
423
dbcmd.CommandText = "DELETE FROM `urlslist` WHERE `http_code1`=" + status + " AND `http_code2`=" + status +
422
424
" AND `http_code3`=" + status + ";";