DevChatter / DevChatterBot

MIT License
55 stars 28 forks source link

Fix Hangfire automated system #213

Closed wtfblub closed 6 years ago

wtfblub commented 6 years ago

Hangfire serializes the expressions to save them in the database and then uses Dependency Injection to resolve instances used in the expressions. To get around this we save the given instance of IIntervalAction in a Dictionary with a id. The expression then calls InvokeAction with the id on the IAutomatedActionSystem interface, which Hangfire will resolve from our DI container