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


##########
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:
   Thanks for the test! I think that is actually a great workaround.



-- 
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