File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -774,15 +774,19 @@ async def inc_org_time_stats(
774
774
If is_qa is true, also update seperate qa only counter
775
775
"""
776
776
# pylint: disable=too-many-return-statements, too-many-locals
777
- key = "crawlExecSeconds" if is_exec_time else "usage"
778
777
yymm = dt_now ().strftime ("%Y-%m" )
779
- inc_query = {f"{ key } .{ yymm } " : duration }
780
- if is_qa :
778
+ inc_query = {}
779
+
780
+ if not is_qa :
781
+ key = "crawlExecSeconds" if is_exec_time else "usage"
782
+ inc_query [f"{ key } .{ yymm } " ] = duration
783
+ else :
781
784
qa_key = "qaCrawlExecSeconds" if is_exec_time else "qaUsage"
782
785
inc_query [f"{ qa_key } .{ yymm } " ] = duration
786
+
783
787
await self .orgs .find_one_and_update ({"_id" : oid }, {"$inc" : inc_query })
784
788
785
- if not is_exec_time :
789
+ if not is_exec_time or is_qa :
786
790
return
787
791
788
792
org = await self .get_org_by_id (oid )
You can’t perform that action at this time.
0 commit comments