# Plugin Config in Controller nicht aktuell

**URL:** https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092
**Category:** Shopware 5
**Created:** [16. März 2021 um 13:11 UTC](https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092 "2021-03-16T13:11:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)
#### Post date: [16. März 2021 um 13:11 UTC](https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092/1 "2021-03-16T13:11:18Z")

</div>

Hallo, ich verwende die Plugin Config meines Plugins in einem Cronjob.

$config = Shopware()-\>Container()  
-\>get(„shopware.plugin.cached\_config\_reader“)  
-\>getByPluginName(„MyPlugin“);

der Aufruf funktioniert auch, allerdings bekomme ich nie die aktuellen Werte aus dem Plugin sondern alte. An was liegt das? Cache hab ich mehrfach gelöscht und so …

---

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [16. März 2021 um 14:16 UTC](https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092/2 "2021-03-16T14:16:41Z")

</div>

Hast du schonmal in der DB geschaut ob der Name nicht doppelt vergeben ist?

---

<div class="post-metadata">

### Author: ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)
#### Post date: [16. März 2021 um 14:41 UTC](https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092/3 "2021-03-16T14:41:50Z")

</div>

Wenn Du in der Plugin-Config etwas geändert hast, hast Du danach auch mal den Config-Cache im Backend geleert?

Wenn nicht: „ **cached** \_config\_reader“ - könnte es daran liegen, das SW den Config-Cache nicht unbedingt leert, wenn eine Plugin-Config gespeichert wird. Ggf. mal ausprobieren, ob das geht: „shopware.plugin.config\_reader“

---

<div class="post-metadata">

### Author: ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)
#### Post date: [17. März 2021 um 10:18 UTC](https://forum.shopware.com/t/plugin-config-in-controller-nicht-aktuell/86092/4 "2021-03-17T10:18:11Z")

</div>

@sonic du hast Recht, das lag wohl wirklich am Cache. Offenbar wird der nicht geleert, selbst wenn man es im Backend tut.  
mit _ **shopware.plugin.config\_reader** _ anstatt dem _ **cached\_config\_reader** _ funktioniert es. Danke!
