You are here

function radioactivity_memcache_get_unprocessed_range in Radioactivity 6

2 calls to radioactivity_memcache_get_unprocessed_range()
radioactivity_debug_memcache_form in plugins/radioactivity_debug.module
radioactivity_process_memcached_entries in ./radioactivity.module

File

./radioactivity.module, line 232

Code

function radioactivity_memcache_get_unprocessed_range() {

  // get newest memcache entry
  $start_entry_id = dmemcache_get('entry_id_processed', 'radioactivity');
  $stop_entry_id = dmemcache_get('entry_id_seq', 'radioactivity');
  if ($stop_entry_id === FALSE) {
    $stop_entry_id = 0;
  }
  else {
    ++$stop_entry_id;
  }
  if ($start_entry_id === FALSE) {
    $start_entry_id = $stop_entry_id;
  }

  // check if entry_id_top has gotten flushed
  if ($stop_entry_id < $start_entry_id) {
    $stop_entry_id = $start_entry_id;
  }
  return array(
    $start_entry_id,
    $stop_entry_id,
  );
}