Project

General

Profile

Task #2485

Feature #2484: Resume ingestion automatically

Resume ingestion automatically on application startup.

Added by Ayush Khandelwal over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
High
Target version:
Start date:
07/07/2022
Due date:
07/07/2022
% Done:

100%

Estimated time:
3.00 h

Description

Scheme for the ticket:

OnApplicationStartup:
   for(book : books):
      if('book' is in on-going state like 'In-progress', 'Updating', 'Completed/In-progress', 'Completed/Find-Comparable-Doc'):
         check last updated time of a 'book' for the ingestion i.e. X = (now - lastUpdatedTime) minutes
         if(isResumeAllowed(X)):
            resume the ingestion for a 'book'

isResumeAllowed(X):
   waiting_allow_time = 10 minutes
   if(X - waiting_allow_time < 0):
      sleep the thread for (waiting_allow_time-X) minutes
   return true;

Reference for running the application on startup:
  1. https://stackoverflow.com/questions/6684451/executing-a-java-class-at-application-startup-using-spring-mvc
  2. https://www.baeldung.com/spring-scheduled-tasks#setting-delay-or-rate-dynamically-at-runtime
Reference for calling the method by some delay:
  1. https://stackoverflow.com/questions/19999231/how-to-start-a-thread-after-specified-time-delay-in-java
  2. https://www.baeldung.com/java-delay-code-execution
#1

Updated by Venmuhilan B over 2 years ago

  • Status changed from New to In Progress
#2

Updated by Venmuhilan B over 2 years ago

  • % Done changed from 0 to 90
#3

Updated by Venmuhilan B over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
#4

Updated by Venmuhilan B over 2 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Venmuhilan B to Ayush Khandelwal
#5

Updated by Ayush Khandelwal about 2 years ago

  • Status changed from Feedback to Closed

Working as expected

Also available in: Atom PDF