rwth-acis / moodle-data-proxy

3 stars 1 forks source link

Moodle Data Proxy dev image #17

Open Michi03 opened 4 years ago

Michi03 commented 4 years ago

Motivation

During development, there are two modifications which sometimes have to applied to the MoodleDataProxyService. Specifically, this concerns the log level and the initial timestamp for receiving updates. In order to avoid a rebuilt of the current image where these things are adjusted, environment variables may be used to provide these options.

Specification

Log level

There are two different ways to achieve a higher log level, both of them could for example be implemented using sed.

  1. Change this line to adjust the log level in the logger directly.
  2. Changing the log level of the respective messages (see e.g., this line). This option is preferable, as there are a lot of superfluous messages on the INFO level logged by the blockchain.

Initial timestamp

In order to get course upgrades, the Moodle API is polled once a minute which is achieved by filtering Moodle update events by their timestamp. The timestamp used in the initial request to the Moodle API is set here. In case some update events were lost, it can be useful to adjust this timestamp. Again there are two different approaches which could be implemented using sed.

  1. Add a binary variable, to either get all updates (set timestamp to 0), or just get latest (set timestamp to current)
  2. Add a free variable to adjust the timestamp (e.g., the variable is the epoch timestamp)

Finalized state

The image should still be the same as it currently is, however with two new environment variables to adjust:

  1. the log level
  2. the timestamp for the initial call to Moodle to get update events

Furthermore, the launch variables section have to be updated in general, and once the above mentioned changes have been implemented should reflect these, too.