Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2011-02-11 14:45:54

Coscast
Member
From: Germany
Registered: 2010-10-03
Posts: 546

[ADDED] Server Active/Inactive only for upload

Hi,

I thought about the follwowing Scenario:

You have a Conversion Server and a Storage Server1 (SS1)
Now Storage Server HDD Space is full.

I add another Storage Server2 (SS2) .

Logically i have to set Storage Server1 to inactive for uploads....because it's full. So now the Script should upload only to SS2.

I overlooked the function VHelper_video_server::get.
This function selects the Server for upload and gets the server data for streaming ( i hope it's correct )

What i want to say: It does not look for the Status of a Server (0/1) or am i wrong ?

Conclusion: At the moment it is not possible to switch off a server JUST for uploading, because this function selects the Server for Streaming/Watching too and if it would look for the Serverstatus, the videos from SS1 ( if SS1 has status 0 ) would not play.

Is this correct? I try to understand PHP Code and i stared at the function for half an hour smile I hope i'am not wrong.


sgt-halfsize-banner.jpg

Offline

#2 2011-02-11 17:11:46

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [ADDED] Server Active/Inactive only for upload

You are correct, and its a mistake on my side, i forgot to add WHERE status = '1' sad Will fix for the next update.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2011-02-14 12:35:16

Coscast
Member
From: Germany
Registered: 2010-10-03
Posts: 546

Re: [ADDED] Server Active/Inactive only for upload

But i think there has to be a database Row in the server Table, like actup ( for active upload ) because if you set a active to 0 this server is completely inactive. That means the videos from this server won't be streamed if there are videos on this server, because the function only looks for active 0/1 and this function pulls the server for streaming not just for uploading.

My intention is: IF the drive is nearly full just make it inactive JUST for uploads.

Maybe i misunderstood the VHelper_video_server::get but for me it looks like it pulls the server for Uploading AND Streaming.

I tested a second function:

public static function getactup($server_id=NULL)
    {
        $add     = ($server_id) ? " WHERE server_id = ".(int) $server_id : '';
        
        VF::factory_remove('database');
        $db     = VF::factory('database');
        $db->query("SELECT *
                    FROM #__server
                    WHERE actup = '1'
                    ORDER BY last_used ASC
                    LIMIT 1");
        if ($db->affected_rows()) {
            return $db->fetch_assoc();
        }
        
        return FALSE;
    }

I use this in convert.php for finding an active upload server. Works.

Last edited by Coscast (2011-02-14 12:39:07)


sgt-halfsize-banner.jpg

Offline

#4 2011-02-14 12:39:09

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [ADDED] Server Active/Inactive only for upload

Yes. You are right the server helper pulls the data with the same function. And you are right it should be separated for upload (or at least a flag on/off). I will make the
changes for the next version.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB