Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2214

Limit memory usage when applying payments to open invoices via cron

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.6.0
    • Fix Version/s: Short Term
    • Component/s: None
    • Labels:
      None

      Description

      When the cron runs to Apply Payments to Open Invoices, a call is made to fetch all clients within each client group via Clients::getAll. Large data sets can cause the memory limit to be exceeded, so we should update this to use an iterator instead.

      We can fetch only client IDs via the iterator, then store those in memory rather than all of the client information. The cron action should only need the client ID, and can continue on as-is.

      e.g. the iterator

      return $this->Record->getStatement();
      

        Activity

        tyson Tyson Phillips (Inactive) created issue -
        tyson Tyson Phillips (Inactive) made changes -
        Field Original Value New Value
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Story Points 2
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.9.0 Sprint 1 [ 98 ]
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.9.0 Sprint 1 [ 98 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 24 minutes [ 1440 ]
        Worklog Id 12950 [ 12950 ]
        tyson Tyson Phillips (Inactive) made changes -
        Epic Link CORE-2429 [ 13521 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 24 minutes
              24m