winterhazel commented on code in PR #11097:
URL: https://github.com/apache/cloudstack/pull/11097#discussion_r2194861742


##########
usage/src/main/java/com/cloud/usage/parser/UsageParser.java:
##########
@@ -16,21 +16,30 @@
 // under the License.
 package com.cloud.usage.parser;
 
-import java.util.Date;
+import com.cloud.usage.dao.UsageDao;
+import com.cloud.user.AccountVO;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
+import javax.inject.Inject;
+import java.util.Date;
 
-import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+public abstract class UsageParser {
+    Logger logger = LogManager.getLogger(getClass());
 
-public abstract class UsageParser extends ManagedContextRunnable {
+    @Inject
+    UsageDao usageDao;
 
-    @Override
-    protected void runInContext() {
-        try {
-            parse(null);
-        } catch (Exception e) {
-            logger.warn("Error while parsing usage events", e);
-        }
+    private void beforeParse(AccountVO account) {
+        logger.debug("Parsing all {} usage events for account: [{}]", 
getParserName(), account.getUuid());

Review Comment:
   The UUID is always `null`. I saw that you already mapped an issue to fix 
this, but I think that we can just log the `account`  here instead to ensure we 
do not lose information in case 4.21 releases without the fix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to