Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
849cb2b3
Commit
849cb2b3
authored
Jan 10, 2018
by
Mike Hibler
Browse files
Fix a DB timestamp issue.
parent
afa1569d
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Lease.pm.in
View file @
849cb2b3
#
!/usr/bin/perl -wT
#
#
Copyright
(
c
)
2012
-
201
7
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2012
-
201
8
University
of
Utah
and
the
Flux
Group
.
#
#
{{{
EMULAB
-
LICENSE
#
...
...
@@ -1488,12 +1488,15 @@ sub SetLastUsedTime($$) {
print STDERR "Lease->SetLastUsedTime: Can'
t
set
lease
last
-
used
time
in
the
future
.\
n
";
return LEASE_ERROR_FAILED();
}
if ($ntime < $self->inception()) {
$ntime = 0;
my $estr;
if ($ntime == 0 || $ntime < $self->inception()) {
$estr = "
DEFAULT
(
last_used
)
";
} else {
$estr = "
FROM_UNIXTIME
($
ntime
)
";
}
my $idx = $self->idx();
DBQueryWarn("
update
project_leases
set
last_used
=
FROM_UNIXTIME
($
ntime
)
where
lease_idx
=$
idx
")
DBQueryWarn("
update
project_leases
set
last_used
=
$
estr
where
lease_idx
=$
idx
")
or return LEASE_ERROR_FAILED();
$self->Refresh();
...
...
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