#729 Reduce memory used for rules, see #728
Merged 4 years ago by misc. Opened 4 years ago by misc.
misc/fedora-badges fix_rules_2  into  master

Reduce memory used for rules, see #728
Michael Scherer • 4 years ago  
file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 1

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 20

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 60

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 90

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 150

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 300

  

file modified
+1 -1
@@ -25,7 +25,7 @@ 

          - "%(msg.user)s"  # The user that was created.

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['status'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['status'] is 1)

        condition:

          greater than or equal to: 999

  

file modified
+1 -1
@@ -30,7 +30,7 @@ 

  #        - "%(msg.comment.update_submitter)s"

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1)

        condition:

          greater than or equal to: 1 

  

file modified
+1 -1
@@ -30,7 +30,7 @@ 

  #        - "%(msg.comment.update_submitter)s"

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1)

        condition:

          greater than or equal to: 10

  

file modified
+1 -1
@@ -30,7 +30,7 @@ 

  #        - "%(msg.comment.update_submitter)s"

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1)

        condition:

          greater than or equal to: 50

  

file modified
+1 -1
@@ -30,7 +30,7 @@ 

  #        - "%(msg.comment.update_submitter)s"

          rows_per_page: 9999999

        operation:

-         lambda: len([msg for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1])

+         lambda: sum(1 for msg in query.all() if msg.msg['comment'].get('update', {}).get('user', {}).get('name', None) == "%(msg.comment.update.user.name)s" and msg.msg['comment']['karma'] is 1)

        condition:

          greater than or equal to: 100