Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SalidasAutomaticas
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
SalidasAutomaticas
Commits
2777b54d
Commit
2777b54d
authored
Sep 22, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT main, programarsalidastask, hilo principal iniciando a las 06:00]
parent
989dbc46
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Main.java
src/salidasautomaticas/main/Main.java
+1
-1
ProgramarSalidasTask.java
src/salidasautomaticas/schedule/ProgramarSalidasTask.java
+4
-1
No files found.
src/salidasautomaticas/main/Main.java
View file @
2777b54d
...
@@ -24,7 +24,7 @@ public class Main {
...
@@ -24,7 +24,7 @@ public class Main {
setLogLevel
(
Level
.
INFO
);
//PRODUCCION
setLogLevel
(
Level
.
INFO
);
//PRODUCCION
log
.
info
(
"Inicializando programa [Salidas Automaticas]..."
);
log
.
info
(
"Inicializando programa [Salidas Automaticas]..."
);
Date
horaInicio
=
Metodos
.
getHoraEjecucion
(
"
12:3
0"
);
Date
horaInicio
=
Metodos
.
getHoraEjecucion
(
"
06:0
0"
);
int
periodo
=
86400000
;
//El codigo se ejecutará cada 24h, 86400000 representa 24h en milisegundos
int
periodo
=
86400000
;
//El codigo se ejecutará cada 24h, 86400000 representa 24h en milisegundos
TimerTask
task
=
new
ProgramarSalidasTask
();
TimerTask
task
=
new
ProgramarSalidasTask
();
...
...
src/salidasautomaticas/schedule/ProgramarSalidasTask.java
View file @
2777b54d
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*/
*/
package
salidasautomaticas
.
schedule
;
package
salidasautomaticas
.
schedule
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.LocalTime
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.Iterator
;
...
@@ -30,6 +31,8 @@ public class ProgramarSalidasTask extends TimerTask {
...
@@ -30,6 +31,8 @@ public class ProgramarSalidasTask extends TimerTask {
public
void
run
()
{
public
void
run
()
{
try
{
try
{
LocalDateTime
hoy
=
LocalDateTime
.
now
();
log
.
info
(
"Obteniendo la lista de horarios ["
+
hoy
.
toString
()
+
"]"
);
JSONArray
listaHorarios
=
service
.
obtenerHorariosSalida
();
JSONArray
listaHorarios
=
service
.
obtenerHorariosSalida
();
Timer
timer
;
Timer
timer
;
...
@@ -51,7 +54,7 @@ public class ProgramarSalidasTask extends TimerTask {
...
@@ -51,7 +54,7 @@ public class ProgramarSalidasTask extends TimerTask {
log
.
trace
(
"Timer "
+
timer
);
log
.
trace
(
"Timer "
+
timer
);
}
else
{
}
else
{
log
.
trace
(
"Ya pasó la hora "
+
horaSalida
);
log
.
warn
(
"No se programa la hora de salida "
+
horaSalida
+
", porque ya ha pasado la hora"
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment