Skip to content

Conversation

@niyolynate
Copy link

@niyolynate niyolynate commented Mar 21, 2022

Still haven't sent my changes, i get errors..
i get errors in git while pushing them. will keep trying though. i added restart @LINE45 - 49 and added time for tasks at line 90-99.

package org.openmrs.module.reporting;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.api.context.Context;
import org.openmrs.module.BaseModuleActivator;
import org.openmrs.module.DaemonToken;
import org.openmrs.module.DaemonTokenAware;
import org.openmrs.module.reporting.common.MessageUtil;
import org.openmrs.module.reporting.report.task.ReportingTimerTask;
import org.openmrs.module.reporting.report.task.RunQueuedReportsTask;

/**

  • This class contains the logic that is run every time this module is either started or shutdown
    */
    public class ReportingModuleActivator extends BaseModuleActivator implements DaemonTokenAware {

    private Log log = LogFactory.getLog(this.getClass());

    @OverRide
    public void contextRefreshed() {
    // This will ensure that the MessageUtil picks back up the current active message source
    MessageUtil.setMessageSource(null);
    }

    @OverRide
    public void started() {
    ReportingTimerTask.setEnabled(true);
    log.info("Reporting Module Started...");
    }

    @OverRide
    public void restart()
    restartAllScheduledTasks();
    restartCurrentRunningReportRequest;
    }

    @OverRide
    public void willStop() {
    cancelAllScheduledTasks();
    cancelCurrentlyRunningReportRequests();
    }

    @OverRide
    public void stopped() {
    log.info("Reporting Module Stopped...");
    }

    @OverRide
    public void setDaemonToken(DaemonToken token) {
    ReportingTimerTask.setDaemonToken(token);
    }

    /**

    • Cancels all scheduled tasks
      /
      private void cancelAllScheduledTasks() {
      for (ReportingTimerTask task : Context.getRegisteredComponents(ReportingTimerTask.class)) {
      try {
      task.cancel();
      }
      catch (Exception e) {
      log.warn("An exception occurred while trying to stop reporting task " + task.getTaskClass().getSimpleName(), e);
      }
      }
      }
      /
      *

    • Cancels all currently running report requests
      */
      private void cancelCurrentlyRunningReportRequests() {
      for (RunQueuedReportsTask task : RunQueuedReportsTask.getCurrentlyRunningRequests().values()) {
      try {
      task.cancelTask();
      }
      catch (Exception e) {
      log.warn("An exception occurred while trying to stop currently running reports", e);

       	//Time lap between the last task to current updates.
       	public voidsetTask(Integer time) {
       		    oldT = t;
       		    t = time;
       		    log.debug("Time set to {}. innitialDate {}.", t, innitialDate);
       		    if(time.intValue() > 50sec) {
       		      log.info("Time passed in days\hr\min\sec.");
       }
      

      }
      }
      }

Ben-Waters and others added 30 commits March 20, 2018 10:41
BirthAndDeathCohortDefinition should query on whether patient is marked as dead
PatientIdentifierDataEvaluator should return all identifiers if no identifier type specified
Additional enhancements to include ability to filter on coded answers
…y deserialize before and after change to convert non-static inner class to static inner-class
… property deserialize before and after change to convert non-static inner class to static inner-class
REPORT-856: ActiveOnDate should Include onset and End dates
wikumChamith and others added 29 commits November 22, 2024 16:44
Also related to O3-1494
---------
Co-authored-by: druchniewicz <[email protected]>
* Migrate to 2.4.0

* Move api-1.9

* Merge old api modules to the main

* Set the scope of reportingcompatibility to provided
* REPORT-913: Migrate to OpenMRS Platform 2.4.0 (#262)

* Migrate to 2.4.0

* Move api-1.9

* Merge old api modules to the main

* Set the scope of reportingcompatibility to provided

(cherry picked from commit e4022f6)

* Remove reporting compatability module

* Remove old datasets
* Update to Platform 2.7.0 and Support Java 21

* Migrate to org.openmrs.test.jupiter.BaseModuleContextSensitiveTest

* Add the EvaluationProfilerTest24On
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.