ArchiveFilesUpdateJob.java
/*
* Copyright © 2026 The CTAN Team and individual authors
*
* This file is distributed under the 3-clause BSD license.
* See file LICENSE for details.
*/
package org.ctan.site.jobs;
import java.io.IOException;
import org.ctan.site.services.texarchive.ArchiveFilesUpdateService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.dropwizard.jobs.Job;
import io.dropwizard.jobs.annotations.On;
import lombok.NonNull;
/**
* The class <code>ArchiveFilesUpdateJob</code> contains the TODO gene.
*
* @author <a href="mailto:gene@ctan.org">Gerd Neugebauer</a>
*/
@On(value = "0 2 * * * *")
public class ArchiveFilesUpdateJob extends Job {
/**
* The field <code>service</code> contains the underlying service.
*/
private ArchiveFilesUpdateService service;
/**
* This is the constructor for <code>CatalogueUpdateTask</code>.
*
* @param service the underlying service
*/
@SuppressFBWarnings(value = {"CT_CONSTRUCTOR_THROW", "EI_EXPOSE_REP2"})
public ArchiveFilesUpdateJob(@NonNull ArchiveFilesUpdateService service) {
this.service = service;
}
/**
* {@inheritDoc}
*
* @see io.dropwizard.jobs.Job#doJob(org.quartz.JobExecutionContext)
*/
@Override
public void doJob(JobExecutionContext context)
throws JobExecutionException {
try {
service.update();
} catch (IOException e) {
throw new JobExecutionException(e);
}
}
}