Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Correctly call bound PeriodicTask functions #190

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

phorward
Copy link
Member

@phorward phorward commented Oct 7, 2019

Hi!

I wondered why my parameter "kinds" in this PeriodicTask-decorated function of my backup-module always contained the module's instance instead of the expected None value:

	@PeriodicTask(24 * 60)
	def backup(self, kinds=None, *args, **kwargs):
		logging.info("kinds = %r", kinds)

		if kinds is None:
			kinds = metadata.get_kinds()
		else:
			kinds = kinds.split(",") # Error 500 raised!

So I found out that the "bound method calling" in tasks.py is incorrect, so this fix should be better. Most PeriodicTask used in our projects do just throw away any parameter with *args, **kwargs, but here this isn't the case.

@tsteinruecken tsteinruecken merged commit e53c744 into master Oct 17, 2019
@tsteinruecken tsteinruecken deleted the bugfix/boundPeriodicTasks branch October 17, 2019 06:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants