Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
SpaceAPI Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Infrastruttura
SpaceAPI Server
Commits
e3668c14
Commit
e3668c14
authored
Jul 11, 2019
by
Aljaž Srebrnič
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder/optimize use calls
parent
62e81714
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
src/main.rs
src/main.rs
+5
-7
No files found.
src/main.rs
View file @
e3668c14
use
std
::
time
::
Duration
;
use
std
::
env
::
var
;
extern
crate
spaceapi_server
;
#[macro_use]
extern
crate
log
;
extern
crate
env_logger
;
extern
crate
spaceapi_server
;
extern
crate
r2d2_redis
;
use
spaceapi_server
::
SpaceapiServerBuilder
;
...
...
@@ -10,14 +12,10 @@ use spaceapi_server::api;
use
spaceapi_server
::
api
::
Keymaster
;
use
spaceapi_server
::
modifiers
::
StatusModifier
;
use
std
::
env
::
var
;
use
r2d2
;
use
r2d2_redis
::
RedisConnectionManager
;
use
redis
;
use
redis
::{
Commands
,
RedisResult
};
type
RedisPool
=
r2d2
::
Pool
<
RedisConnectionManager
>
;
type
RedisPool
=
r2d2
::
Pool
<
r2d2_redis
::
RedisConnectionManager
>
;
struct
OpenStatusFromRedisModifier
{
pool
:
RedisPool
...
...
@@ -111,7 +109,7 @@ fn main() {
.expect
(
"Creating status failed"
);
let
redis_connstring
=
var
(
"REDIS_CONNSTRING"
)
.unwrap_or
(
String
::
from
(
"redis://localhost"
));
let
manager
=
RedisConnectionManager
::
new
(
&*
redis_connstring
)
.unwrap
();
let
manager
=
r2d2_redis
::
RedisConnectionManager
::
new
(
&*
redis_connstring
)
.unwrap
();
let
pool
=
RedisPool
::
builder
()
.connection_timeout
(
Duration
::
from_secs
(
1
))
.build
(
manager
)
...
...
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