Skip to content

Commit

Permalink
feat: Disable SQS call for temp
Browse files Browse the repository at this point in the history
  • Loading branch information
BEMELON committed Dec 6, 2023
1 parent 48e856e commit 750fba0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
24 changes: 11 additions & 13 deletions scrapy_crawler/Bungae/TotalSearch/spiders/BgKeywordSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
from typing import List
from urllib import parse

import boto3
import scrapy
from scrapy import signals
from scrapy.utils.project import get_project_settings
from sqlalchemy.orm import sessionmaker
from twisted.python.failure import Failure

Expand Down Expand Up @@ -33,17 +31,17 @@ class BgKeywordSpider(scrapy.Spider):

def __init__(self, keyword=None, *args, **kwargs):
super().__init__(*args, **kwargs)
settings = get_project_settings()
sqs = boto3.resource(
"sqs",
aws_access_key_id=settings["AWS_ACCESS_KEY_ID"],
aws_secret_access_key=settings["AWS_SECRET_ACCESS_KEY"],
region_name=settings["AWS_REGION_NAME"],
)

self.live_queue = sqs.get_queue_by_name(
QueueName=settings["AWS_LIVE_QUEUE_NAME"]
)
# settings = get_project_settings()
# sqs = boto3.resource(
# "sqs",
# aws_access_key_id=settings["AWS_ACCESS_KEY_ID"],
# aws_secret_access_key=settings["AWS_SECRET_ACCESS_KEY"],
# region_name=settings["AWS_REGION_NAME"],
# )
#
# self.live_queue = sqs.get_queue_by_name(
# QueueName=settings["AWS_LIVE_QUEUE_NAME"]
# )
self.session = sessionmaker(bind=get_engine())()
self.exception_slack_bot: ExceptionSlackBot = ExceptionSlackBot()
self.keyword = keyword
Expand Down
25 changes: 12 additions & 13 deletions scrapy_crawler/Joonggonara/TotalSearch/spiders/JgKeywordSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import json
from urllib import parse

import boto3
# import boto3
import scrapy
from scrapy import signals
from scrapy.utils.project import get_project_settings
from sqlalchemy.orm import sessionmaker
from twisted.python.failure import Failure

Expand Down Expand Up @@ -36,17 +35,17 @@ class JgKeywordSpider(scrapy.Spider):

def __init__(self, keyword=None, *args, **kwargs):
super().__init__(*args, **kwargs)
settings = get_project_settings()
sqs = boto3.resource(
"sqs",
aws_access_key_id=settings["AWS_ACCESS_KEY_ID"],
aws_secret_access_key=settings["AWS_SECRET_ACCESS_KEY"],
region_name=settings["AWS_REGION_NAME"],
)

self.live_queue = sqs.get_queue_by_name(
QueueName=settings["AWS_LIVE_QUEUE_NAME"]
)
# settings = get_project_settings()
# sqs = boto3.resource(
# "sqs",
# aws_access_key_id=settings["AWS_ACCESS_KEY_ID"],
# aws_secret_access_key=settings["AWS_SECRET_ACCESS_KEY"],
# region_name=settings["AWS_REGION_NAME"],
# )
#
# self.live_queue = sqs.get_queue_by_name(
# QueueName=settings["AWS_LIVE_QUEUE_NAME"]
# )
self.session = sessionmaker(bind=get_engine())()
self.exception_slack_bot: ExceptionSlackBot = ExceptionSlackBot()
self.keyword = keyword
Expand Down

0 comments on commit 750fba0

Please sign in to comment.