Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #2

Open
andrewthetechie opened this issue Oct 14, 2019 · 0 comments
Open

Add unit tests #2

andrewthetechie opened this issue Oct 14, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@andrewthetechie
Copy link
Owner

This plugin needs unit tests.

https://errbot.readthedocs.io/en/latest/user_guide/plugin_development/testing.html

@andrewthetechie andrewthetechie added enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed labels Oct 14, 2019
andrewthetechie added a commit that referenced this issue Oct 5, 2020
The theory: I am seeing disconnects in the errbot log that the bot
"restarts" itself. This is "activating" multiple apschedulers because we
are using the in-memory store. This is causing the multiple posts.
Probably was causing the multiple posts with scheduler too.

This change does a couple of things:

* Sets up a webhook that we can use as a bit of a "rpc". The blocker for
using the apscheduler storage backends was trying to pickle the "plugin"
object as a part of the schedule job. This allows us to call a method
that is outside of the class, that can then "call" our class (via the
webhook request).
* Allows configuring the apscheduler by passing in a path to a json
config file. This json file gets read into a python Dict to config like
Method #2 from
https://apscheduler.readthedocs.io/en/stable/userguide.html#configuring-the-scheduler
* Changes config variable names a bit to "namespace" our env variables a
bit
* Adds the ability to "reset" a post so that it can be reposted
andrewthetechie added a commit that referenced this issue Oct 11, 2020
* fix: fix multiposts and new apscheduler options

The theory: I am seeing disconnects in the errbot log that the bot
"restarts" itself. This is "activating" multiple apschedulers because we
are using the in-memory store. This is causing the multiple posts.
Probably was causing the multiple posts with scheduler too.

This change does a couple of things:

* Sets up a webhook that we can use as a bit of a "rpc". The blocker for
using the apscheduler storage backends was trying to pickle the "plugin"
object as a part of the schedule job. This allows us to call a method
that is outside of the class, that can then "call" our class (via the
webhook request).
* Allows configuring the apscheduler by passing in a path to a json
config file. This json file gets read into a python Dict to config like
Method #2 from
https://apscheduler.readthedocs.io/en/stable/userguide.html#configuring-the-scheduler
* Changes config variable names a bit to "namespace" our env variables a
bit
* Adds the ability to "reset" a post so that it can be reposted

* fix: shutdown scheduler on deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant