Posts made by Howard Miller

Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
context_system is (unusually) defined as a 'class_alias' of 'core\context\system'. The alias is defined in lib/accesslib.php (around line 5000). The class is defined in the file lib/classes/context/system.php.

I think we should be using \core\context\system::instance() but nobody does. Anyway, check that the definition is there but I suspect the class_alias may be what's upsetting VSC.
Average of ratings: Useful (1)
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You want to be looking at Scheduled tasks... Site administration > Server > Scheduled tasks.

I'm not sure which enrolment plugin you are using. I've never used payments and I'm not sure exactly how it works. However, I assume it's just a variation on manual. You will notice that the various tasks for manual enrolment run every ten minutes. So, at worst it takes 10 mins to catch up with un-enrolment. Unless something else is delaying tasks. Anyway, you can diagnose that from the last run time and the task logs.

You should also be (ideally) running cron every minute (not every 4).

However (your post is a bit long and I may have missed it) I couldn't figure out what you mean by "forever"?
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Are you using Matrix?

For full disclosure - I didn't even know that Matrix existed, or the Moodle addition to use it, until 5 mins ago. So I don't know how much help I'm going to be smile