Skip to content

Hotfix/memory usage #36

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions bin/read-all-feeds
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
#!/usr/bin/env sh

# This do not work when running through docker compose exec.
# It defaults to /home/deploy and not the working dir.
#
#dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
Comment on lines +3 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How and where does this not evaluate to /app/bin when run with docker compose exec?

I assume it's run as docker compose --file docker-compose.server.yml exec phpfpm bin/read-all-feeds and in this case the working directory must be /app (otherwise bin/read-all-feeds does not exist).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the servers cron job where it executes from.

It returns no-such-file /home/deploy/console @rimi-itk so the old way don't default to /app/bin as not bash context have been loaded...

#
# So for now lets assume we always are inside an ITKDev docker cotainer.
dir=/app/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dir=/app/bin
dir=$(cd $(dirname "$0") && pwd)

or

Suggested change
dir=/app/bin
# @see https://stackoverflow.com/a/1638397
dir=$(cd $(dirname "$(readlink -f "$0")") && pwd)


# Read all feeds one by one to isoloate any fatal errors thrown when reading a feed.
for id in $($dir/console events:feed:read --list | grep '^id:' | sed 's/^id: *//'); do
$dir/console events:feed:read --id=$id
php -d memory_limit=-1 $dir/console events:feed:read --id=$id
done