refinements after fresh builds
This commit is contained in:
parent
265f92af35
commit
1b275517fd
|
@ -8,5 +8,4 @@ WORKDIR /app
|
|||
|
||||
EXPOSE 3000
|
||||
|
||||
RUN npm ci --loglevel verbose --legacy-peer-deps
|
||||
CMD npx prisma migrate dev && npm run dev
|
||||
CMD ["sh","-c","npm ci --loglevel verbose --legacy-peer-deps && npx prisma migrate dev && npm run dev"]
|
18
anon.sql
18
anon.sql
|
@ -162656,4 +162656,22 @@ UPDATE "Item" p SET (ncomments, "commentMsats") =
|
|||
FROM "Item" c
|
||||
WHERE c.path <@ p.path AND p.id <> c.id);
|
||||
|
||||
CREATE OR REPLACE FUNCTION RefreshAllMaterializedViews(schema_arg TEXT DEFAULT 'public')
|
||||
RETURNS INT AS $$
|
||||
DECLARE
|
||||
r RECORD;
|
||||
BEGIN
|
||||
RAISE NOTICE 'Refreshing materialized view in schema %', schema_arg;
|
||||
FOR r IN SELECT matviewname FROM pg_matviews WHERE schemaname = schema_arg
|
||||
LOOP
|
||||
RAISE NOTICE 'Refreshing %.%', schema_arg, r.matviewname;
|
||||
EXECUTE 'REFRESH MATERIALIZED VIEW ' || schema_arg || '.' || r.matviewname;
|
||||
END LOOP;
|
||||
|
||||
RETURN 1;
|
||||
END
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT RefreshAllMaterializedViews();
|
||||
|
||||
INSERT INTO pgboss.job (name) VALUES ('indexAllItems');
|
||||
|
|
|
@ -5,7 +5,7 @@ services:
|
|||
build: ./db
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "PGPASSWORD=$$POSTGRES_PASSWORD psql -U $$POSTGRES_USER $$POSTGRES_DB -c 'SELECT 1'"]
|
||||
test: ["CMD-SHELL", "PGPASSWORD=$$POSTGRES_PASSWORD psql -U $$POSTGRES_USER $$POSTGRES_DB -c 'SELECT 1 FROM users LIMIT 1'"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
@ -96,7 +96,7 @@ services:
|
|||
image: opensearchproject/opensearch:latest
|
||||
container_name: opensearch
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -ku admin:admin --silent --fail localhost:9200/_cluster/health || exit 1"]
|
||||
test: ["CMD-SHELL", "curl -ku admin:mVchg1T5oA9wudUh --silent --fail localhost:9200/_cluster/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
@ -105,6 +105,7 @@ services:
|
|||
environment:
|
||||
- discovery.type=single-node
|
||||
- plugins.security.disabled=true
|
||||
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=mVchg1T5oA9wudUh
|
||||
ports:
|
||||
- 9200:9200 # REST API
|
||||
- 9600:9600 # Performance Analyzer
|
||||
|
@ -114,12 +115,12 @@ services:
|
|||
bash -c '
|
||||
set -m
|
||||
/usr/share/opensearch/opensearch-docker-entrypoint.sh &
|
||||
until curl -sS "http://localhost:9200/_cat/health?h=status" -ku admin:admin | grep -q "green\|yellow"; do
|
||||
until curl -sS "http://localhost:9200/_cat/health?h=status" -ku admin:mVchg1T5oA9wudUh | grep -q "green\|yellow"; do
|
||||
echo "Waiting for OpenSearch to start..."
|
||||
sleep 1
|
||||
done
|
||||
echo "OpenSearch started."
|
||||
curl -X PUT "http://localhost:9200/item" -ku admin:admin
|
||||
curl -X PUT "http://localhost:9200/item" -ku admin:mVchg1T5oA9wudUh
|
||||
echo "OpenSearch index created."
|
||||
fg
|
||||
'
|
||||
|
|
Loading…
Reference in New Issue