Hi dallasclark
Thank you for your reply
here is the content of my /config/database.js. The value of connection.client
= postgres.
module.exports = ({ env }) => ({
connection: {
client: "postgres",
connection: {
host: env("DATABASE_HOST"),
port: env.int("DATABASE_PORT"),
database: env("DATABASE_NAME"),
user: env("DATABASE_USERNAME"),
password: env("DATABASE_PASSWORD"),
ssl: env.bool("DATABASE_SSL", true),
},
debug: true,
acquireConnectionTimeout: 1000000,
options: {
pool: {
min: 1,
max: 10,
acquireTimeoutMillis: 900000,
createTimeoutMillis: 900000,
destroyTimeoutMillis: 900000,
},
},
},
});
-
In the
/config
folder, do you have separate folders for different environments
No, I don have any folder in the/config
folder
I’ve taken a brief look at the logs when Strapi starts up, but I can’t seem to find the name of the specified instance. I am currently investigating this in more detail.
However, after adding a collection type in develop mode, I confirmed that the table has been created in CloudSQL by logging in and executing the \dt
command. Therefore, I believe that the connection to the database is successful.
Accutualy, I have set the minimum number of cloud run instances to zero (cold start). This means that in addition to restarts that happen when I execute commands such as gcloud run deploy
, restarts also occur after a certain period of inactivity or when there are no requests. It seems that in develop mode, data deletion also happens during these restarts.