Skip to content

Commit 8983d63

Browse files
committed
improve stacks
1 parent 8e6ae66 commit 8983d63

File tree

9 files changed

+26
-7
lines changed

9 files changed

+26
-7
lines changed

compose.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ services:
3535
- bootstrap.memory_lock=true
3636
- ES_JAVA_OPTS=-Xms512m -Xmx512m # 512mo HEAP
3737
- ELASTIC_PASSWORD=admin
38+
healthcheck:
39+
test: "curl -s -u elastic:$$ELASTIC_PASSWORD -f -X GET localhost:9200/_cluster/health || exit 1"
40+
interval: 10s
41+
timeout: 5s
42+
retries: 30
3843
networks:
3944
- app-network
4045
ports:
@@ -65,7 +70,7 @@ services:
6570
SERVER_NAME: localhost api.openchurch.local admin.openchurch.local
6671
APP_ENV: dev
6772
APP_SECRET: "secret"
68-
DATABASE_URL: mysql://root:openchurch@db:3306/openchurch?serverVersion=11.5.2-MariaDB&charset=utf8mb4
73+
DATABASE_URL: mysql://root:openchurch@db:3306/openchurch?serverVersion=10.11.6-MariaDB&charset=utf8mb4
6974
REDIS_URL: redis://redis:6379
7075
HOST_API: https://api.openchurch.local/api
7176
HOST_ADMIN: admin.openchurch.local
@@ -83,7 +88,7 @@ services:
8388
environment:
8489
SERVER_NAME: :80
8590
APP_ENV: prod
86-
DATABASE_URL: "mysql://openchurch:openchurch@db:3306/openchurch?serverVersion=8.0&charset=utf8mb4"
91+
DATABASE_URL: mysql://root:openchurch@db:3306/openchurch?serverVersion=10.11.6-MariaDB&charset=utf8mb4
8792
HOST_API: api-preprod-openchurch.hozana.org
8893
APP_SECRET: JK6nAUJQhFXMwiBvqHE_3UX8RyCeFEec
8994
JWT_TOKEN_TTL: 120

docker/php/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN docker-php-ext-install \
3030
xsl \
3131
pcntl \
3232
opcache \
33+
intl \
3334
gmp
3435

3536
# add PECL extensions

scripts/synchro.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ def update_dioceses(self, sparqlData, client):
332332
response = client.upsert_wikidata_entities('/communities/upsert', wikidataEntities)
333333
self.print_logs(response, 1)
334334
return response
335+
return "skipped"
335336

336337
def update_parishes(self, sparqlData, client):
337338
wikidataEntities = {'wikidataEntities': []}
@@ -344,6 +345,7 @@ def update_parishes(self, sparqlData, client):
344345
response = client.upsert_wikidata_entities('/communities/upsert', wikidataEntities)
345346
self.print_logs(response, 1)
346347
return response
348+
return "skipped"
347349

348350
def update_churches(self, sparqlData, client):
349351
wikidataEntities = {'wikidataEntities': []}
@@ -356,6 +358,7 @@ def update_churches(self, sparqlData, client):
356358
response = client.upsert_wikidata_entities('/places/upsert', wikidataEntities)
357359
self.print_logs(response, 1)
358360
return response
361+
return "skipped"
359362

360363
def print_logs(self, data, required_level):
361364
if self.verbosity_level >= required_level:
@@ -448,7 +451,11 @@ def process_batch(self, data, method, run_id):
448451
self.redis_client.hset(key_batch, "runId", run_id)
449452
print("Processing batch %s/%s" % (iteration, len(batches)))
450453
res = getattr(self.q, method)(batch, self.client)
451-
if res:
454+
if res == "skipped":
455+
self.redis_client.hset(key_batch, "successCount", "skipped")
456+
self.redis_client.hset(key_batch, "failureCount", "skipped")
457+
self.redis_client.hset(key_batch, "status", "skipped")
458+
elif res:
452459
success_count = sum(1 for value in res.values() if value in {'Updated', 'Inserted'})
453460
self.redis_client.hset(key_batch, "successCount", success_count)
454461
self.redis_client.hset(key_batch, "failureCount", len(res) - success_count)

src/Dashboard/Infrastructure/Twig/detail.html.twig

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
green
1919
{% elseif data.status == 'processing' %}
2020
orange
21+
{% elseif data.status == 'skipped' %}
22+
blue
2123
{% else %}
2224
red
2325
{% endif %}">

tests/Agent/Integration/DoctrineAgentRepositoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace App\Tests\FieldHolder\Community\Integration\Doctrine;
5+
namespace App\Tests\Agent\Integration;
66

77
use App\Agent\Infrastructure\Doctrine\DoctrineAgentRepository;
88
use App\Tests\Agent\DummyFactory\DummyAgentFactory;

tests/Field/Integration/DoctrineFieldListenerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace App\Tests\Field\Integration\Doctrine;
5+
namespace App\Tests\Field\Integration;
66

77
use App\Core\Domain\Search\Helper\SearchHelperInterface;
88
use App\Core\Domain\Search\Service\SearchServiceInterface;

tests/FieldHolder/Community/Integration/DoctrineCommunityListenerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace App\Tests\FieldHolder\Community\Integration\Doctrine;
5+
namespace App\Tests\FieldHolder\Community\Integration;
66

77
use App\Core\Domain\Search\Helper\SearchHelperInterface;
88
use App\Core\Domain\Search\Service\SearchServiceInterface;

tests/FieldHolder/Community/Integration/DoctrineCommunityRepositoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace App\Tests\FieldHolder\Community\Integration\Doctrine;
5+
namespace App\Tests\FieldHolder\Community\Integration;
66

77
use App\Field\Domain\Enum\FieldCommunity;
88
use App\FieldHolder\Community\Domain\Enum\CommunityType;

usr/local/bin/docker-php-entrypoint

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ if [ "$ROLE" == 'cli' ]; then
9595
mv /etc/cron.d/openchurch_env /etc/cron.d/backend
9696

9797
# Initialize elastic indexes
98+
until curl -s -u elastic:$ELASTIC_PASSWORD -f -X GET $ELASTICSEARCH_IRI/_cluster/health > /dev/null; do
99+
echo "Waiting for elasticsearch to be ready..."
100+
sleep 5
101+
done
98102
bin/console -vvv app:write:indexes
99103
fi
100104

0 commit comments

Comments
 (0)