Starting from r_keeper version 7.5.4, it is possible to update only selected collections at the lower-level server linked to the restaurant. This article describes the process of selective and scheduled synchronization.
The following options are available at the moment:
- If there is a need to update references in a local restaurant manually, use the Sync references button in the Service menu. This may be required if urgent synchronization of changes with the head office is needed.
- Standard (automatic) synchronization is performed on client demand to an upper-level server in the following cases:
- On schedule, which is editable
- At startup
- At shutdown
- Or by settings combination.
- The client requests collection versions. When collections are changed, the upper-level server prepares the collections package for transmission to the client after the client's request.
The client used to download collections in full, i. e., all the tables.
Now, the upper-level server prepares the collection with modified data only for the client that issued a request. Thus, modified data for restaurant А will be sent only to restaurant А. Restaurants В, С, etc. will only get their own data.
- Collections distribution based on their usage is only supported starting from version 7.5.5.*.
The synchronization schedule is edited in a separate file — Syncconfig.ini.
Specify the path to this file in the report server .ini file: SyncSchdFile = "Y:\syncconf.ini". If this parameter is not specified, the file must be named syncconf.ini, and be located along with the server:
The file contains an optional common section [*] and sections related to report servers (network names).
The server checks presence of this file at startup, then searches a section with its network name in it. If there is no such section, it uses parameters from the common section [*]. If there is no common section, the server keeps working in a standard way.
Example of the schedule settings file (any of section can be missing):
[*] RefsSyncMode = 1 ;; synchronization execution time in CRON.CRON format 50 10 * * * means "always at 10:50". See more details at https://en.wikipedia.org/wiki/Cron SyncSchedule = 40 20 * * * SyncOnUpLink = 0 SyncOnReload = 0 ;; filter by collection IDs, starting from 188.8.131.52 names are accepted RestFilterIn = 137,61,63,71,70,94,152,159,48,49,59,79 ;; list of IDs of collections (starting from 184.108.40.206 names are accepted) for which only active elements are transmitted skipDeleteIn = EMPLOYEES [IMxREPS2x1] RefsSyncMode = 1 SyncSchedule = 30 10 * * * SyncOnUpLink = 0 SyncOnReload = 0 [IMxREPS2x2] RefsSyncMode = 1 SyncSchedule = 30 10 * * * SyncOnUpLink = 0 SyncOnReload = 0
Parameters are independent of each other
* RefsSyncMode — whether scheduled synchronization is enabled. If not, there will be no synchronization on time, but there will be synchronization when the connection is restored and the server is started.
* SyncOnUpLink — whether synchronization when connecting to the upper-level server is enabled. If not, synchronization will not occur when the connection is restored.
* SyncOnReload — to synchronize at server startup. If the parameter is set to 0 but SyncOnUpLink = 1, synchronization will still be performed when the connection is restored. So, although this parameter is independent, it only makes sense with SyncOnUpLink = 0.
* SyncSchedule — synchronization execution time in CRON format. CRON 50 10 * * * means always at 10:50. See more details at https://en.wikipedia.org/wiki/Cron
This format allows to perform synchronization at any time but once a day. Therefore, specifying hours and minutes is mandatory.
Possible operational scheme:
REP TRANSIT constant synchronization but filtering is used (REST_FILTER_IN)
REP Local Restaurant Server (scheduled synchronization)
For REP_TRANSIT generally syncconf.ini
RefsSyncMode = 0 SyncSchedule = * SyncOnUpLink = 1 SyncOnReload = 1 RestFilterIn = 137,61,63,71,70,94,152,159,48,49,59,79 // filter by collection IDs, starting from 220.127.116.11 names are accepted skipDeleteIn = EMPLOYEES // list of IDs of collections (starting from 18.104.22.168 names are accepted) for which only active elements are transmitted
Filter does not work for all collections! Filter only works in case of full collection flow.
- Manual — at the manager station
- By the web request.
In this case, you should either perform settings in order not to use authorization or to configure authorization, which is more difficult. See more detail in the Integrating with r_keeper Using XML interface article.
The request should look as follows: https://127.0.0.1:8080/rk7api/v1/forceSyncRefs.xml
To disable authorization forcibly, specify httpauthmode = -1 in the server .ini file. This option is supported starting from 7.5.4.*
Starting from 7.5.5.*, you can edit this setting in the cash server .ini file