push.run

Controls if a Push data source is allowed to to run or not.

Key: push.run
Type: Boolean
Can be set in: collection.cfg

Description

This option is useful when it is necessary to edit the live directory of a push data source especially in a multi server setup.

When set to false, a previously running push data source will be stopped within a few seconds and prevented from restarting.

Once the push data source is not stopped:

  • Most API calls for the push data source will be rejected including add/delete document calls and make new snapshot.

  • Existing snapshots may still be listed and have their contents read.

  • Modifications to the live push directory, such as moving the content of a snapshot back into the live directory, may be safely performed.

  • If the push data source is in slave mode, it will stop syncing from master.

  • The push data source will prevent slaves from pulling new data from it.

Before making changes to the live directory, you should confirm via the API that the push data source has stopped running or syncing:

  • GET push-api/v1/collections/[PUSH_DATA_SOURCE_ID]/state

  • GET push-api/v1/sync/collections/[PUSH_DATA_SOURCE_ID]/state

Also verify that API calls do not start the push data source, for example use the GET document API call:

GET push-api/v2/collections/[PUSH_DATA_SOURCE_ID]/documents?key=http%3A%2F%2Fany.url%2F

The API should not return with a 200 or 404 and should return a message containing:

Push can not be started because 'push.run' is set false.

Default Value

By default push data sources are allowed to run.

push.run=true

Examples

In case the live directory needs to be edited for example to restore a snapshot the push data source can be told not to run:

push.run=false

⚠ Caveats

When set to false, queries will still be allowed to run against the push data source.

See Also