Your Name преди 6 години
родител
ревизия
490863d742
променени са 3 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 1 1
      hg3535/pipeline/roll_zuqiu.py
  2. 6 0
      hg3535/settings.py
  3. 3 2
      hg3535/spiders/jieshu.py

+ 1 - 1
hg3535/pipeline/roll_zuqiu.py

@@ -7,7 +7,7 @@ import logging
 
 from twisted.internet import defer, reactor
 
-from .ball_func import fuhao
+# from .ball_func import fuhao
 from ..utils.helper import Helper
 # from .ball_func import get_pcode
 from ..settings import M_HOST, M_USER, M_PASSWORD, M_POST, M_DB, LEAGUE_URL, ODDS_URL, MATCH_URL, MATCH_RESULT

+ 6 - 0
hg3535/settings.py

@@ -152,6 +152,12 @@ TOKEN_URL = "http://stadmin.bocai108.com/getToken"
 MATCH_RESULT = "http://stadmin.bocai108.com:19093/setMatchResult"
 MATCH_STATUS = "http://stadmin.bocai108.com/upMatch"
 ODDSCH = "http://stadmin.bocai108.com/setOddsCH"
+
+
+R_HOST = '192.168.2.200'
+R_POST = 6379
+R_DB = 1
+R_PASSWORD = 123456
 #upMatch
 # POST_HOST = 'localhost'
 # POST_DATABASE = 'kaiyou'

+ 3 - 2
hg3535/spiders/jieshu.py

@@ -7,6 +7,7 @@ import redis
 import scrapy
 
 from ..items import Hgjieshu
+from ..settings import R_HOST, R_PASSWORD, R_POST, R_DB
 
 
 class HgjieshuSpider(scrapy.Spider):
@@ -20,7 +21,7 @@ class HgjieshuSpider(scrapy.Spider):
         # 'LOG_LEVEL': 'DEBUG',
         # 'LOG_FILE': "../hg3535/log/saiguo{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
     }
-    rls = redis.Redis(host='192.168.2.200', port=6379, db=1, password=123456)
+    rls = redis.Redis(host=R_HOST, port=R_POST, db=R_DB, password=R_PASSWORD)
 
     def start_requests(self):
         match_ids = self.rls.smembers("hg3535.gunqiu.ids")
@@ -38,7 +39,7 @@ class HgjieshuSpider(scrapy.Spider):
             if not status:
                 ball = data['i'][31]
                 match_id = data['i'][2]
-                # self.rls.srem('hg3535.zq.gunqiu', data)
+                self.rls.srem('hg3535.zq.gunqiu', data)
                 item = Hgjieshu()
                 item['ball'] = ball
                 item['match_id'] = match_id