The problem: I open a drush php:cli
shell and run the following:
>>> \Drupal::entityTypeManager()->getStorage('paragraph')->load(477)->get('field_end_time')->getValue()[0]['value'];
=> "05:01"
I then change the value in the database to 05:02
via the admin panel (content section).
But if I run the same command again in the shell, I still get 05:01
.
If I close the shell and open a new one I get 05:02
. How do I demand the latest data without terminating the process and starting over? This seems like it must be a basic thing but I've searched far and wide and tried clearing caches and etc. but no dice.
This is affecting me because I have a PHP process that is started by cron that handles a Websocket connections and the same thing is happening there—it's getting stale data from the database.
Thanks for the help.
drupal_flush_all_caches();
in between you will get the right value, but that's probably not what you want? What exactly are you updating that value for? Why a Paragraph when it looks more like config? Can you maybe add some more context? Many thanks 😊