Skip to content

Commit

Permalink
Generate dates.txt now in workflow main thread Closed #818 (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubervila authored Feb 6, 2024
1 parent bd268d0 commit a42c730
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 199 deletions.
9 changes: 3 additions & 6 deletions predict_occultation/src/asteroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def download_jpl_bsp(self, end_period, force=False, start_period=None):
}
)

log.info("Asteroid [%s] BSP Downloaded in %s" % (self.name, tdelta))
log.info(f"Asteroid BSP Downloaded in {tdelta}")

return data
except Exception as e:
Expand All @@ -335,7 +335,7 @@ def check_bsp_jpl(self, end_period, days_to_expire=None, start_period=None):
tp0 = dt.now(tz=timezone.utc)

try:
log.debug("Asteroid [%s] Checking BSP JPL" % self.name)
log.debug("Asteroid Checking BSP JPL")

if days_to_expire is None:
days_to_expire = self.__BSP_DAYS_TO_EXPIRE
Expand Down Expand Up @@ -384,10 +384,7 @@ def check_bsp_jpl(self, end_period, days_to_expire=None, start_period=None):
# BSP que já existe atente todos os critérios não será necessário um novo Download.
bsp_jpl = self.bsp_jpl
bsp_jpl["downloaded_in_this_run"] = False
log.info(
"Asteroid [%s] Pre-existing BSP is still valid and will be reused."
% self.name
)
log.info("Asteroid Pre-existing BSP is still valid and will be reused.")

if not bsp_jpl:
# Fazer um novo Download do BSP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@


def generate_dates_file(start_date, final_date, step, filename):

print(f"Generate dates file: start:[{start_date}] final: [{final_date}]")

app_path = os.environ.get("APP_PATH").rstrip('/')
data_dir = os.environ.get("DIR_DATA").rstrip('/')
output = os.path.join(data_dir, filename)
Expand Down
Loading

0 comments on commit a42c730

Please sign in to comment.