Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Release Maven artifacts of Policy Service
[nonrtric.git]
/
test
/
mrstub
/
app
/
main.py
diff --git
a/test/mrstub/app/main.py
b/test/mrstub/app/main.py
index
5bb0988
..
75b23f1
100644
(file)
--- a/
test/mrstub/app/main.py
+++ b/
test/mrstub/app/main.py
@@
-25,6
+25,15
@@
from flask import Flask
from flask import Response
import traceback
from threading import RLock
from flask import Response
import traceback
from threading import RLock
+import logging
+
+# Disable all logging of GET on reading counters
+class AjaxFilter(logging.Filter):
+ def filter(self, record):
+ return ("/counter/" not in record.getMessage())
+
+log = logging.getLogger('werkzeug')
+log.addFilter(AjaxFilter())
app = Flask(__name__)
lock = RLock()
app = Flask(__name__)
lock = RLock()
@@
-211,6
+220,12
@@
def events_write():
try:
answer=request.json
print(AGENT_WRITE_URL+ " json=" + json.dumps(answer, indent=2))
try:
answer=request.json
print(AGENT_WRITE_URL+ " json=" + json.dumps(answer, indent=2))
+ if isinstance(answer, dict):
+ #Create a an array if the answer is a dict (single message)
+ answer_list=[]
+ answer_list.append(answer)
+ answer=answer_list
+
for item in answer:
id=item['correlationId']
if (id is None):
for item in answer:
id=item['correlationId']
if (id is None):