|
@@ -11,6 +11,8 @@ import org.cobbzilla.util.daemon.SimpleDaemon; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
import static java.util.concurrent.TimeUnit.HOURS; |
|
|
import static java.util.concurrent.TimeUnit.HOURS; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.now; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.now; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; |
|
@@ -25,7 +27,7 @@ public class AppDataCleaner extends SimpleDaemon { |
|
|
|
|
|
|
|
|
@Override protected void process() { |
|
|
@Override protected void process() { |
|
|
try { |
|
|
try { |
|
|
final int ct = dataDAO.bulkDeleteWhere("expiration < " + now(), null); |
|
|
|
|
|
|
|
|
final int ct = dataDAO.bulkDeleteWhere("expiration < " + now(), new HashMap<>()); |
|
|
log.info("process: removed " + ct + " expired AppData records"); |
|
|
log.info("process: removed " + ct + " expired AppData records"); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
reportError("AppDataCleaner.process: "+shortError(e), e); |
|
|
reportError("AppDataCleaner.process: "+shortError(e), e); |
|
|