Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vecna
lox
Commits
13d098ea
Commit
13d098ea
authored
9 months ago
by
Vecna
Browse files
Options
Downloads
Patches
Plain Diff
Artificially advance time on BridgeDb
parent
766516ce
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#174968
failed
9 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
crates/lox-distributor/src/lox_context.rs
+3
-0
3 additions, 0 deletions
crates/lox-distributor/src/lox_context.rs
crates/lox-library/src/lib.rs
+11
-0
11 additions, 0 deletions
crates/lox-library/src/lib.rs
with
14 additions
and
0 deletions
crates/lox-distributor/src/lox_context.rs
+
3
−
0
View file @
13d098ea
...
...
@@ -415,6 +415,9 @@ impl LoxServerContext {
let
mut
ba_obj
=
self
.ba
.lock
()
.unwrap
();
ba_obj
.advance_days
(
num
);
// FOR TESTING ONLY
println!
(
"Today's date according to server: {}"
,
ba_obj
.today
());
// Also advance days for BridgeDb
let
mut
db_obj
=
self
.db
.lock
()
.unwrap
();
db_obj
.advance_days
(
num
);
// FOR TESTING ONLY
}
// Encrypts the Lox bridge table, should be called after every sync
...
...
This diff is collapsed.
Click to expand it.
crates/lox-library/src/lib.rs
+
11
−
0
View file @
13d098ea
...
...
@@ -287,6 +287,17 @@ impl BridgeDb {
Err
(
SignatureError
::
new
())
}
}
///#[cfg(test)]
/// For testing only: manually advance the day by the given number
/// of days
pub
fn
advance_days
(
&
mut
self
,
days
:
u16
)
{
if
days
>
0
{
self
.today
+=
Duration
::
days
(
days
.into
());
// Reset daily bridges distributed count
self
.daily_bridges_distributed
=
0
;
}
}
}
impl
Default
for
BridgeDb
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment