CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2023-08-30
by pymen

Original Post

Original - Posted on 2023-08-30
by pymen



            
Present in both answers; Present only in the new answer; Present only in the old answer;

For **Django >= 4.1** you can enable [persistent connections][1] with [health-checks][2]

``` DATABASES = { 'default': { 'CONN_HEALTH_CHECKS': True, 'CONN_MAX_AGE': 60, # <= Mysql `interactive_timeout`/`wait_timeout` } } ```
As result for each db request Django will ping database to check "if connection is alive" (DatabaseWrapper.is_usable) and if not -> Django will close connection

[1]: https://docs.djangoproject.com/en/4.2/ref/databases/#persistent-database-connections [2]: https://docs.djangoproject.com/en/4.2/ref/settings/#conn-max-age
For **Django >= 4.1** you can enable [persistent connections][1] with [health-checks][2]

``` DATABASES = { 'default': { 'CONN_HEALTH_CHECKS': True, 'CONN_MAX_AGE': 60, # <= Mysql `interactive_timeout`/`wait_timeout` } } ```
As result for each db request Django will ping database to check "if connection is alive" (DatabaseWrapper.is_usable) and if not -> Django will close connection

[1]: https://docs.djangoproject.com/en/4.2/ref/databases/#persistent-database-connections [2]: https://docs.djangoproject.com/en/4.2/ref/settings/#conn-max-age

        
Present in both answers; Present only in the new answer; Present only in the old answer;