# Conflicts:
#	pom.xml
#	src/main/java/org/ccalm/weather/AirTemperature.java
#	src/main/java/org/ccalm/weather/SoilTmperature.java
This commit is contained in:
2024-07-08 12:38:03 +05:00
3 changed files with 27 additions and 1 deletions

View File

@ -80,7 +80,7 @@
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin> <!--plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version> <version>3.2.0</version>

View File

@ -256,6 +256,13 @@ public class Precipitation implements ServletContextAware {
logger.error("N6:"+ex.getMessage(),ex); logger.error("N6:"+ex.getMessage(),ex);
} }
logger.info("Delete old data 3"); logger.info("Delete old data 3");
try {
String sql="delete from main.precipitation_dates where date=cast(to_timestamp('"+date+" "+time+"', 'YYYYMMDD HH24') as timestamp without time zone) and hours="+forecast;
st.executeUpdate(sql);
} catch (SQLException ex) {
logger.info(ex.getMessage());
}
System.out.println("Delete old data 3");
try { try {
String sql="delete from main.precipitation where date<=CURRENT_DATE-'730 days'::INTERVAL"; String sql="delete from main.precipitation where date<=CURRENT_DATE-'730 days'::INTERVAL";
st.executeUpdate(sql); st.executeUpdate(sql);

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<!-- Ротирующий файловый аппендер -->
<RollingFile name="RollingFile" fileName="logs/application.log"
filePattern="logs/application-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
<Policies>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="ALL">
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>