Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dyndns-server
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Schulcz Ferenc
dyndns-server
Commits
fe98642c
Commit
fe98642c
authored
4 months ago
by
Ferenc Schulcz
Browse files
Options
Downloads
Patches
Plain Diff
RamDB: fix loops again
parent
a670bfa0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ramdb.js
+6
-4
6 additions, 4 deletions
ramdb.js
with
6 additions
and
4 deletions
ramdb.js
+
6
−
4
View file @
fe98642c
...
@@ -10,8 +10,8 @@ function init() {
...
@@ -10,8 +10,8 @@ function init() {
function
domainExists
(
domain
)
{
function
domainExists
(
domain
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
for
(
let
record
in
ramDB
)
{
for
(
let
record
Index
in
ramDB
)
{
if
(
r
ecord
.
domain
==
domain
)
{
if
(
r
amDB
[
recordIndex
]
.
domain
==
domain
)
{
resolve
(
true
);
resolve
(
true
);
return
;
return
;
}
}
...
@@ -34,7 +34,8 @@ function registerDomain(domain, token) {
...
@@ -34,7 +34,8 @@ function registerDomain(domain, token) {
function
getDomain
(
token
)
{
function
getDomain
(
token
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
for
(
let
record
in
ramDB
)
{
for
(
let
recordIndex
in
ramDB
)
{
let
record
=
ramDB
[
recordIndex
];
if
(
record
.
token
==
token
)
{
if
(
record
.
token
==
token
)
{
resolve
(
record
);
resolve
(
record
);
return
;
return
;
...
@@ -46,7 +47,8 @@ function getDomain(token) {
...
@@ -46,7 +47,8 @@ function getDomain(token) {
function
updateDomain
(
domain
,
token
,
ip
)
{
function
updateDomain
(
domain
,
token
,
ip
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
for
(
let
record
in
ramDB
)
{
for
(
let
recordIndex
in
ramDB
)
{
let
record
=
ramDB
[
recordIndex
];
if
(
record
.
domain
==
domain
)
{
if
(
record
.
domain
==
domain
)
{
record
.
token
=
token
;
record
.
token
=
token
;
record
.
ip
=
ip
;
record
.
ip
=
ip
;
...
...
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