Add all the triggers that will keep the file up to date only if the persistence
is enabled.
355452
private static void addTriggers()
   {
      if (!PERSISTENCE_ENABLED)
      {
         return;
      }
      Runtime.getRuntime().addShutdownHook(new Thread("JCRStatisticsManager-Hook")
      {
         @Override
         public void run()
         {
            printData();
         }
      });
      Thread t = new Thread("JCRStatisticsManager-Writer")
      {
         @Override
         public void run()
         {
            while (true)
            {
               try
               {
                  sleep(PERSISTENCE_TIMEOUT);
               }
               catch (InterruptedException e)
               {
                  LOG.debug("InterruptedException", e);
               }
               printData();
            }
         }
      };
      t.setDaemon(true);
      t.start();
   }
373504
public function markAsPersisted(): void
    {
        $this->markNew(false);
        $this->dispatchEvent(new Event\Persisted($this));
    }
1149827
function _onRegistryDownloaded() {
        var availableUpdates = ExtensionManager.getAvailableUpdates();
        PreferencesManager.setViewState("extensionUpdateInfo", availableUpdates);
        PreferencesManager.setViewState("lastExtensionRegistryCheckTime", (new Date()).getTime());
        $("#toolbar-extension-manager").toggleClass("updatesAvailable", availableUpdates.length > 0);
    }
518433
def trigger_created(self, filepath):
        """"""
        if os.path.exists(filepath):
            self._trigger('created', filepath)
917246
public function persist(): void
    {
        foreach ($this->create() as $seed) {
            $this->seeder->persist($seed);
            $this->persistedSeeds++;
        }

        $this->seeder->flush();
    }
1050888
@Override
    public void putStaticInfo(Persistable staticInfo) {
        List<StatsStorageEvent> sses = checkStorageEvents(staticInfo);
        if (!sessionIDs.contains(staticInfo.getSessionID())) {
            sessionIDs.add(staticInfo.getSessionID());
        }
        SessionTypeWorkerId id = new SessionTypeWorkerId(staticInfo.getSessionID(), staticInfo.getTypeID(),
                        staticInfo.getWorkerID());

        this.staticInfo.put(id, staticInfo);
        db.commit(); //For write ahead log: need to ensure that we persist all data to disk...
        StatsStorageEvent sse = null;
        if (!listeners.isEmpty())
            sse = new StatsStorageEvent(this, StatsStorageListener.EventType.PostStaticInfo, staticInfo.getSessionID(),
                            staticInfo.getTypeID(), staticInfo.getWorkerID(), staticInfo.getTimeStamp());
        for (StatsStorageListener l : listeners) {
            l.notify(sse);
        }

        notifyListeners(sses);
    }
447744
def update(self, source_file, configuration, declarations, included_files):
        

        record = record_t(
            source_signature=file_signature(source_file),
            config_signature=configuration_signature(configuration),
            included_files=included_files,
            included_files_signature=list(
                map(
                    file_signature,
                    included_files)),
            declarations=declarations)
        # Switched over to holding full record in cache so we don't have
        # to keep creating records in the next method.
        self.__cache[record.key()] = record
        self.__cache[record.key()].was_hit = True
        self.__needs_flushed = True
1242497
private function executeEnabled(): void
  {
    if ($this->constantsFilename!==null)
    {
      $this->executeColumnWidths();
    }

    if ($this->className!==null)
    {
      $this->executeCreateConstants();
    }

    $this->logNumberOfConstants();
  }
72796
def get_all_triggers(bump, file_triggers):
    """"""
    triggers = set()
    if file_triggers:
        triggers = triggers.union(detect_file_triggers(config.trigger_patterns))
    if bump:
        _LOG.debug("trigger: %s bump requested", bump)
        triggers.add(bump)
    return triggers
527039
def persist(self):
        """"""
        if self.hash:
            with open(self.file_name, 'wb') as f:
                pickle.dump(self.object_property, f)
            return True
        return False
708889
protected function addTrigger()
    {
        $this->controlAccess('trigger_add');

        if ($this->trigger->add($this->getSubmitted())) {
            $this->redirect('admin/settings/trigger', $this->text('Trigger has been added'), 'success');
        }

        $this->redirect('', $this->text('Trigger has not been added'), 'warning');
    }
973244
public static function enable()
    {
        Builder::macro(self::MACRO_METHOD, function (Fluent $builder, $createdAt = 'createdAt', $updatedAt = 'updatedAt', $type = 'dateTime') {
            $builder->{$type}($createdAt)->timestampable()->onCreate();
            $builder->{$type}($updatedAt)->timestampable()->onUpdate();
        });
    }
678990
def save_sensors(self):
        """"""
        if not self.need_save:
            return
        fname = os.path.realpath(self.persistence_file)
        exists = os.path.isfile(fname)
        dirname = os.path.dirname(fname)
        if (not os.access(dirname, os.W_OK) or exists and
                not os.access(fname, os.W_OK)):
            _LOGGER.error('Permission denied when writing to %s', fname)
            return
        split_fname = os.path.splitext(fname)
        tmp_fname = '{}.tmp{}'.format(split_fname[0], split_fname[1])
        _LOGGER.debug('Saving sensors to persistence file %s', fname)
        self._perform_file_action(tmp_fname, 'save')
        if exists:
            os.rename(fname, self.persistence_bak)
        os.rename(tmp_fname, fname)
        if exists:
            os.remove(self.persistence_bak)
        self.need_save = False
1312764
private void addFullTrigger(String tenantId, FullTrigger fullTrigger) throws Exception {
        if (null == fullTrigger) {
            throw new IllegalArgumentException("FullTrigger must be not null");
        }
        if (fullTrigger.getTrigger() != null) {
            Trigger trigger = fullTrigger.getTrigger();
            trigger.setTenantId(tenantId);
            addTrigger(trigger);
            if (!isEmpty(fullTrigger.getDampenings())) {
                for (Dampening d : fullTrigger.getDampenings()) {
                    d.setTenantId(tenantId);
                    d.setTriggerId(trigger.getId());
                    addDampening(d);
                }
            }
            if (!isEmpty(fullTrigger.getConditions())) {
                setAllConditions(tenantId, trigger.getId(), fullTrigger.getConditions());
            }
        }
    }
1269356
protected function addTrigger()
    {
        if (!$this->isError()) {
            $state_id = $this->trigger->add($this->getSubmitted());
            if (empty($state_id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($state_id);
        }
    }
529265
public TriggerContext on(Collection<Trigger> triggers) {
        if (triggers != null) {
            addedTriggers.addAll(triggers);
        }

        // Stay in the same context and re-use the same instance because no type has changed
        return this;
    }
165892
def add_trigger(self, trigger):
        
        # Make sure triggers are re-sorted before a new reply can be requested
        self.sorted = False

        # If no trigger with this priority level has been defined yet, create a new list
        if trigger.priority not in self._triggers:
            self._triggers[trigger.priority] = [trigger]
            return

        # Otherwise, add this trigger to an existing priority list
        self._triggers[trigger.priority].append(trigger)