Compare commits
No commits in common. "6300aa6b4a4a5a8c4ff7983d1ed546b22cf1bd9a" and "f326e62c41fd83c193029cbcf8564b1807e6b639" have entirely different histories.
6300aa6b4a
...
f326e62c41
@ -5,6 +5,7 @@ from flask_restful import Api
|
|||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||||
|
|
||||||
|
import rabbitmqqueue
|
||||||
from config import *
|
from config import *
|
||||||
from db import db
|
from db import db
|
||||||
from marshm import ma
|
from marshm import ma
|
||||||
|
@ -5,9 +5,9 @@ from xeger import Xeger
|
|||||||
from flask_restful import Resource
|
from flask_restful import Resource
|
||||||
from flask import request
|
from flask import request
|
||||||
import requests
|
import requests
|
||||||
import pika
|
|
||||||
from db import db
|
from db import db
|
||||||
from models import SampleMetadata
|
from models import SampleMetadata
|
||||||
|
from rabbitmqqueue import rabbitmq_channel
|
||||||
from schemas import SampleSchema, SampleMetadataSchema
|
from schemas import SampleSchema, SampleMetadataSchema
|
||||||
from config import *
|
from config import *
|
||||||
|
|
||||||
@ -76,10 +76,6 @@ class SampleResource(Resource):
|
|||||||
soundfile,
|
soundfile,
|
||||||
soundfile.content_type,
|
soundfile.content_type,
|
||||||
{'Content-Length': soundfile.content_length})}).raise_for_status()
|
{'Content-Length': soundfile.content_length})}).raise_for_status()
|
||||||
credentials = pika.PlainCredentials(RABBITMQ_USERNAME, RABBITMQ_PASSWORD)
|
|
||||||
rabbitmq = pika.BlockingConnection(pika.ConnectionParameters(host=RABBITMQ_HOST, credentials=credentials))
|
|
||||||
rabbitmq_channel = rabbitmq.channel()
|
|
||||||
rabbitmq_channel.exchange_declare(exchange=RABBITMQ_EXCHANGE, exchange_type='fanout')
|
|
||||||
rabbitmq_channel.basic_publish(
|
rabbitmq_channel.basic_publish(
|
||||||
exchange=RABBITMQ_EXCHANGE,
|
exchange=RABBITMQ_EXCHANGE,
|
||||||
routing_key='feature',
|
routing_key='feature',
|
||||||
|
Loading…
Reference in New Issue
Block a user