Compare commits

...

2 Commits

Author SHA1 Message Date
6300aa6b4a
Merge branch 'master' of gitea:birbnetes/input-service
All checks were successful
continuous-integration/drone/push Build is passing
2020-06-20 20:03:27 +02:00
7dd66a895c
temporary fiksz 2020-06-20 20:03:19 +02:00
2 changed files with 5 additions and 2 deletions

View File

@ -5,7 +5,6 @@ from flask_restful import Api
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
import rabbitmqqueue
from config import *
from db import db
from marshm import ma

View File

@ -5,9 +5,9 @@ from xeger import Xeger
from flask_restful import Resource
from flask import request
import requests
import pika
from db import db
from models import SampleMetadata
from rabbitmqqueue import rabbitmq_channel
from schemas import SampleSchema, SampleMetadataSchema
from config import *
@ -76,6 +76,10 @@ class SampleResource(Resource):
soundfile,
soundfile.content_type,
{'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(
exchange=RABBITMQ_EXCHANGE,
routing_key='feature',