-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b2b685
commit b5f7adb
Showing
5 changed files
with
80 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
BROKER_URL = "amqp://username:password@localhost:5672//" | ||
# 需要先在RabbitMQ上创建fast_dev这个vhost | ||
|
||
broker_url = "amqp://admin:[email protected]:5672/fast_dev" | ||
broker_url = "amqp://rabbitMQ_username:rabbitMQ_password@localhost:5672/fast_dev" | ||
|
||
|
||
BASE_REPORT_URL = "http://localhost:8000/api/fastrunner/reports" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# tasks.py | ||
from celery import shared_task | ||
from mock.models import MockAPILog | ||
|
||
|
||
@shared_task | ||
def log_mock_api(request_obj, request_id, api_id, project_id, req_time, response_obj): | ||
log_obj = MockAPILog.objects.create( | ||
request_obj=request_obj, | ||
request_id=request_id, | ||
api_id=api_id, | ||
project_id=project_id, | ||
create_time=req_time | ||
) | ||
log_obj.response_obj = response_obj | ||
log_obj.save() | ||
return log_obj.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters