Skip to content

Conversation

@imarchis
Copy link

@imarchis imarchis commented Sep 5, 2017

Hi all!

I made a fix for this outstanding issue:
#290

Requirement: Prevent turnitintooltwo cron task from creating multiple connections if the turnitin server is not responding.

Solution: throwing an error/exception and stopping the task execution
Implementation: using the built-in exceptions handling of the turnitintooltwo plugin (turnitintooltwo_comms::handle_exceptions) to minimise the impact of the fix.

This will ensure the task is not proceeding further if the turntin server is not responding (in 120s) and that no performance is lost due to the multiple connection attempts and just one unsuccessful attempt to connect to the Turnitin server will stop the cron task execution.

Also, this way, multiple occurrences of the error will additionally delay the task execution by the Moodle cron system (see https://docs.moodle.org/dev/Task_API#Failures for more info).

No changes to the actual cron task have been made, this means that it will fail the same way it does so far, just not affecting the performance of the website.

Happy coding!
Cheers,
Johnny

Ionut Marchis added 2 commits September 5, 2017 11:17
Change-Id: If5b86cd19f980e4ca20c2274fc4f6def6e2d7411
Change-Id: Ib7056f193cc71579ecdeb8397da4d7fd71df7393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant