Support from Acquia helps fund testing for Drupal Acquia logo

Comments

abhishek-anand created an issue. See original summary.

abhishek-anand’s picture

naveenvalecha’s picture

Status: Needs work » Needs review
abhishek-anand’s picture

abhishek-anand’s picture

abhishek-anand’s picture

Status: Needs review » Needs work

The last submitted patch, 5: port_cache-2695175-5.patch, failed testing.

Berdir’s picture

  1. +++ b/src/Logger/CacheLogEntry.php
    @@ -15,16 +20,14 @@ class CacheLogEntry extends LogEntry {
    +    $expire = $settings['timeout'] > 0 ? time() + $settings['timeout'] : $settings['timeout'];
     
    -    $settings = $job->getSettings('logger');
    +    \Drupal::cache($settings['bin'])
    +      ->set('uc-name:' . $this->name, $this->lid, $expire);
    +    \Drupal::cache($settings['bin'])
    
    +++ b/src/Plugin/ultimate_cron/Logger/CacheLogger.php
    @@ -94,7 +93,7 @@ class CacheLogger extends LoggerBase {
           '#title' => t('Cache timeout'),
    -      '#description' => t('Seconds before cache entry expires (0 = never, -1 = on next general cache wipe).'),
    +      '#description' => t('Seconds before cache entry expires (0 = never).'),
    

    I don't think 0 means what it thinks.

  2. +++ b/src/Plugin/ultimate_cron/Logger/CacheLogger.php
    @@ -38,18 +39,16 @@ class CacheLogger extends LoggerBase {
    -
    -    $job = ultimate_cron_job_load($name);
    -    $settings = $job->getSettings('logger');
    +    $settings = $log_entry->logger->configuration;
     
    

    I don't think this is the same? before, we loaded settings from the job, now we access the just-created log entry object?

abhishek-anand’s picture

Status: Needs work » Needs review
FileSize
4.51 KB
2.21 KB

I don't think 0 means what it thinks.

Yes for expires argument in d7 CACHE_PERMANENT (-1), CACHE_TEMPORARY (0), Unix timestamp.
In D8 we have only CacheBackendInterface::CACHE_PERMANENT (-1) and and Unix timestamp:

This has been corrected.

I don't think this is the same? before, we loaded settings from the job, now we access the just-created log entry object?

This has been corrected as well.

Also, time() has been replaced with REQUEST_TIME

Also, this issue will require https://www.drupal.org/node/2692781 for the tests to pass.

Status: Needs review » Needs work

The last submitted patch, 9: port_cache-2695175-9.patch, failed testing.

abhishek-anand’s picture

Status: Needs work » Needs review
abhishek-anand’s picture

Berdir’s picture

Title: Port CacheLogEntry and DatabaseLogEntry to Drupal 8 » Complete port of CacheLogger
Priority: Normal » Major
Status: Needs review » Needs work

The two log entry classes are removed in #2731683: LogEntry::save() should move to LoggerPlugin. The save method is moved to CacheLogger.

Also not seeing any database related changes here (anymore), so this is just about CacheLogger now.

Shouldn't be necessary to depend on #2692781: Make global setting ui dynamic and use it for those fixes here.

Berdir’s picture

Title: Complete port of CacheLogger » Complete port of CacheLogger, clean up loggers
Status: Needs work » Needs review
FileSize
1.72 KB
12.26 KB

Ok, restarted this. Ended up doing a bunch of cleanup in the database logger as well.

Also added tests for the cache logger.

The last submitted patch, 14: port_cache-2695175-14-test-only.patch, failed testing.

Berdir’s picture

Status: Needs review » Fixed

Passed, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.